[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:
@@ -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),
|
||||
|
||||
Vendored
+6
@@ -2,6 +2,12 @@
|
||||
/// <reference types="vite/client" />
|
||||
/// <reference types="vite-plugin-pwa/client" />
|
||||
|
||||
/**
|
||||
* Which shell the game was built for (vite.config.ts): `'web'` for the PWA, `'tauri'` for the
|
||||
* Android, iOS and desktop apps. Read in App.svelte only, for wiring (CLAUDE.md §2).
|
||||
*/
|
||||
declare const __ROSEA_SHELL__: 'web' | 'tauri';
|
||||
|
||||
declare module 'virtual:rosea-library' {
|
||||
import type { HopeSentence } from '@rosea/schema';
|
||||
/** The verified hope library, bundled at build time after validate:library passed (day-sentence.md P5). */
|
||||
|
||||
Reference in New Issue
Block a user