diff --git a/src/assets/icon.png b/src/assets/icon.png new file mode 100644 index 0000000..d63f283 Binary files /dev/null and b/src/assets/icon.png differ diff --git a/src/assets/logo.png b/src/assets/logo.png deleted file mode 100644 index a5f23ae..0000000 Binary files a/src/assets/logo.png and /dev/null differ diff --git a/src/assets/logo.svg b/src/assets/logo.svg deleted file mode 100644 index d57771c..0000000 --- a/src/assets/logo.svg +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/src/views/Home.vue b/src/views/Home.vue index 0d756c4..7e944c3 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -45,6 +45,24 @@ + + + Already Installed! + + The device already has the application installed! Check your apps + for an app called "IQP Tools", with this icon: + + + + + Close + + + + { e.preventDefault(); installPromptEvent = e as BeforeInstallPromptEvent; }); -const isInStandaloneMode = - "standalone" in window.navigator && window.navigator.standalone; -function installPWA() { - if (platform.value.ios) { +const isInStandaloneMode = window.matchMedia( + "(display-mode: standalone)", +).matches; +async function installPWA() { + let installed = false; + //check if browser version supports the api + if ("getInstalledRelatedApps" in window.navigator) { + const relatedApps = await navigator.getInstalledRelatedApps(); + installed = relatedApps.length > 0; + } + if (installed || true) { + alreadyInstalledOverlay.value = true; + } else if (platform.value.ios) { iosInstallOverlay.value = true; } else if (installPromptEvent) { installPromptEvent.prompt(); diff --git a/vite.config.ts b/vite.config.ts index c068ec8..5856e3e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -55,6 +55,12 @@ export default defineConfig({ purpose: "maskable", }, ], + related_applications: [ + { + platform: "webapp", + url: "https://iss-scooter-data-collection.web.app", + }, + ], shortcuts: [ { name: "Take Data",