From 3e2ba107e3175a1cc1a870d1afe5e3a5eb358b42 Mon Sep 17 00:00:00 2001 From: Alexander Bocken Date: Mon, 23 Mar 2026 17:38:17 +0100 Subject: [PATCH] android: enable offline sync and hide theme toggle in Tauri app Detect Tauri via __TAURI__ in pwaStore so the offline recipe sync, image caching, and auto-sync activate in the Android shell. --- src/lib/stores/pwa.svelte.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/stores/pwa.svelte.ts b/src/lib/stores/pwa.svelte.ts index 374d58a..8ad929b 100644 --- a/src/lib/stores/pwa.svelte.ts +++ b/src/lib/stores/pwa.svelte.ts @@ -30,10 +30,13 @@ function createPWAStore() { let autoSyncInterval: ReturnType | null = null; - // Check if running as installed PWA (standalone mode) + // Check if running as installed PWA or Tauri app function checkStandaloneMode(): boolean { if (!browser) return false; + // Check Tauri Android shell + if ('__TAURI__' in window) return true; + // Check display-mode media query (works on most browsers) const standaloneQuery = window.matchMedia('(display-mode: standalone)'); if (standaloneQuery.matches) return true;