feat: implement offline synchronization with mutation queue and background sync
- Created useOfflineSync hook for connectivity detection and sync management - Implemented localStorage-based mutation queue for offline operations - Added background sync support in service worker - Created OfflineIndicator component to show connection status - Added offline-aware action wrappers for seamless offline/online transitions - Implemented conflict handling with retry logic (up to 3 retries) - Auto-sync when connection is restored - Validates Requirements 4.5
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import type { Metadata } from 'next'
|
||||
import './globals.css'
|
||||
import ServiceWorkerRegistration from '@/components/ServiceWorkerRegistration'
|
||||
import OfflineIndicator from '@/components/OfflineIndicator'
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'Ultimate Lists',
|
||||
@@ -36,6 +37,7 @@ export default function RootLayout({
|
||||
</head>
|
||||
<body className="bg-gray-50 min-h-screen">
|
||||
<ServiceWorkerRegistration />
|
||||
<OfflineIndicator />
|
||||
{children}
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user