feat(offline): add frontend offline state store
- Create offlineStore.ts with status and settings management - Add 30-second polling for offline status checks - Listen for backend offline-status-changed events - Integrate with app bootstrap for initialization and cleanup - Export getters: isOffline, getOfflineReason, getStatus, getSettings - Export actions: setManualOffline, setShowPartialPlaylists, refreshStatus cc
This commit is contained in:
1 parent
02240f41ac
commit
1b9fff3746
2 files changed
+201
No files matched your search
@@ -10,6 +10,7 @@ import { getCurrentWebview } from '@tauri-apps/api/webview';
|
||||
import { goBack, goForward } from '$lib/stores/navigationStore';
|
||||
import { loadToastsPreference } from '$lib/stores/toastStore';
|
||||
import { loadSystemNotificationsPreference } from '$lib/services/playbackService';
|
||||
import { initOfflineStore, cleanupOfflineStore } from '$lib/stores/offlineStore';
|
||||
|
||||
// ============ Theme Management ============
|
||||
|
||||
@@ -118,9 +119,13 @@ export function bootstrapApp(): BootstrapResult {
|
||||
// Restore Last.fm session (async, fire-and-forget)
|
||||
restoreLastfmSession();
|
||||
|
||||
// Initialize offline store (async, fire-and-forget)
|
||||
initOfflineStore();
|
||||
|
||||
return {
|
||||
cleanup: () => {
|
||||
cleanupMouse();
|
||||
cleanupOfflineStore();
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in new issue
Block a user