diff --git a/src/ambient.d.ts b/src/ambient.d.ts index d1b3ba2..92a9a6b 100644 --- a/src/ambient.d.ts +++ b/src/ambient.d.ts @@ -28,8 +28,9 @@ interface BeforeInstallPromptEvent extends Event { prompt(): Promise; } -declare global { - interface WindowEventMap { - beforeinstallprompt: BeforeInstallPromptEvent; - } +declare interface WindowEventMap { + beforeinstallprompt: BeforeInstallPromptEvent; +} +declare interface Navigator { + getInstalledRelatedApps: () => Promise>; } diff --git a/src/views/Home.vue b/src/views/Home.vue index 7e944c3..e089999 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -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)", @@ -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;