[tauri] TauriPlatforms: The shell around the built game, the Android privacy patch, the shell build of the game, and the device check

This commit is contained in:
2026-11-17 18:45:37 +01:00
parent 3f95a1b37d
commit a93ef09956
33 changed files with 5902 additions and 86 deletions
+9 -2
View File
@@ -59,8 +59,14 @@
persisted: async () => (browserStorage?.persisted ? browserStorage.persisted() : null),
persist: async () => (browserStorage?.persist ? browserStorage.persist() : null)
};
// The Android, iOS and desktop apps are installed by being apps (tauri-platforms.md D9):
// they ask to keep the garden after the first care, as an installed PWA does, and never
// show the hint to add the page to the home screen.
const inApp = __ROSEA_SHELL__ === 'tauri';
const installed = (): boolean =>
matchMedia('(display-mode: standalone)').matches || (navigator as Navigator & { standalone?: boolean }).standalone === true;
inApp ||
matchMedia('(display-mode: standalone)').matches ||
(navigator as Navigator & { standalone?: boolean }).standalone === true;
// An installed app is asked once, after the first care of a visit: by then there is
// something to lose, and installed apps are not met with a permission prompt (K5).
let askedToKeep = false;
@@ -82,7 +88,8 @@
// --- A new version waiting (calm-refresh.md) ----------------------------
// The worker is registered here so the page hears when a new version has installed
// and waits. It is offered, never swapped in by itself (U2).
// and waits. It is offered, never swapped in by itself (U2). In the apps there is no
// worker: this registerSW does nothing, and a new version comes as a new app.
let updateReady = $state(false);
const updateSW = registerSW({
onNeedRefresh: () => (updateReady = true),