diff --git a/src/lib/utils.ts b/src/lib/utils.ts index d6377a05..6ff3bce0 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -19,6 +19,24 @@ type FlyAndScaleParams = { }; +export function isPWAInstalled() { + try { + // For iOS (Safari) + + const isInStandaloneMode = window.navigator.standalone; + + // For Android and other platforms + const isStandalone = window.matchMedia("(display-mode: standalone)").matches; + + return isInStandaloneMode || isStandalone; + } + catch(e) { + console.log(e) + return false; + } + +} + export const computeGrowthSingleList = (data, actualList) => { // Initialize the result list diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 478c00fa..b760b75d 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,5 +1,3 @@ - -