Initial release: DictIA v0.8.14-alpha (fork de Speakr, AGPL-3.0)
This commit is contained in:
39
static/js/modules/state/pwa.js
Normal file
39
static/js/modules/state/pwa.js
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* PWA state management
|
||||
*/
|
||||
|
||||
export function createPWAState(ref) {
|
||||
// --- Install Prompt ---
|
||||
const deferredInstallPrompt = ref(null);
|
||||
const showInstallButton = ref(false);
|
||||
const isPWAInstalled = ref(false);
|
||||
|
||||
// --- Notifications ---
|
||||
const notificationPermission = ref('default');
|
||||
const pushSubscription = ref(null);
|
||||
|
||||
// --- Badging ---
|
||||
const appBadgeCount = ref(0);
|
||||
|
||||
// --- Media Session ---
|
||||
const currentMediaMetadata = ref(null);
|
||||
const isMediaSessionActive = ref(false);
|
||||
|
||||
return {
|
||||
// Install prompt
|
||||
deferredInstallPrompt,
|
||||
showInstallButton,
|
||||
isPWAInstalled,
|
||||
|
||||
// Notifications
|
||||
notificationPermission,
|
||||
pushSubscription,
|
||||
|
||||
// Badging
|
||||
appBadgeCount,
|
||||
|
||||
// Media session
|
||||
currentMediaMetadata,
|
||||
isMediaSessionActive
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user