Skip to content

Commit

Permalink
fix dom typing and removed install shim
Browse files Browse the repository at this point in the history
  • Loading branch information
xyven1 committed Oct 5, 2023
1 parent 7a381b7 commit 310a268
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/ambient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ interface BeforeInstallPromptEvent extends Event {
prompt(): Promise<void>;
}

declare global {
interface WindowEventMap {
beforeinstallprompt: BeforeInstallPromptEvent;
}
declare interface WindowEventMap {
beforeinstallprompt: BeforeInstallPromptEvent;
}
declare interface Navigator {
getInstalledRelatedApps: () => Promise<sequence<RelatedApplication>>;
}
4 changes: 2 additions & 2 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const unknownInstallOverlay = ref(false);
let installPromptEvent: BeforeInstallPromptEvent | null = null;
window.addEventListener("beforeinstallprompt", (e) => {
e.preventDefault();
installPromptEvent = e as BeforeInstallPromptEvent;
installPromptEvent = e;
});
const isInStandaloneMode = window.matchMedia(
"(display-mode: standalone)",
Expand All @@ -108,7 +108,7 @@ async function installPWA() {
const relatedApps = await navigator.getInstalledRelatedApps();
installed = relatedApps.length > 0;
}
if (installed || true) {
if (installed) {
alreadyInstalledOverlay.value = true;
} else if (platform.value.ios) {
iosInstallOverlay.value = true;
Expand Down

0 comments on commit 310a268

Please sign in to comment.