diff --git a/src/store/slices/syncSlice.ts b/src/store/slices/syncSlice.ts index 7baaa21..6cad873 100644 --- a/src/store/slices/syncSlice.ts +++ b/src/store/slices/syncSlice.ts @@ -9,6 +9,8 @@ import { db } from '@/lib/db' export type SyncStatus = 'idle' | 'syncing' | 'success' | 'error' +const SYNCABLE_STORES = new Set(['files', 'models', 'components', 'workflows']) + interface SyncState { status: SyncStatus lastSyncedAt: number | null @@ -77,6 +79,10 @@ export const syncFromFlaskBulk = createAsyncThunk( } for (const [key, value] of Object.entries(data)) { + const [storeName, id] = key.split(':') + + if (SYNCABLE_STORES.has(storeName)) { + await db.put(storeName as any, value) if (typeof key !== 'string') { continue }