feat: Refactor service worker registration and enhance offline download manager with client-side checks

This commit is contained in:
2025-08-11 12:31:08 +00:00
committed by GitHub
parent 452af2f6f0
commit 8b5dbbe854
4 changed files with 116 additions and 13 deletions

View File

@@ -86,7 +86,10 @@ export function useOfflineLibrarySync() {
window.addEventListener('online', handleOnline);
window.addEventListener('offline', handleOffline);
setIsOnline(navigator.onLine);
// Check if navigator is available (client-side only)
if (typeof navigator !== 'undefined') {
setIsOnline(navigator.onLine);
}
return () => {
window.removeEventListener('online', handleOnline);