Define syncable store set

This commit is contained in:
2026-01-18 18:27:12 +00:00
parent cd9e65d4d2
commit 7544c5c2e5

View File

@@ -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
@@ -72,10 +74,7 @@ export const syncFromFlaskBulk = createAsyncThunk(
for (const [key, value] of Object.entries(data)) {
const [storeName, id] = key.split(':')
if (storeName === 'files' ||
storeName === 'models' ||
storeName === 'components' ||
storeName === 'workflows') {
if (SYNCABLE_STORES.has(storeName)) {
await db.put(storeName as any, value)
}
}