fix: harden persistence checks and export timeout

This commit is contained in:
dayuan.jiang
2026-01-25 14:33:20 +09:00
parent 384221c498
commit 7525253499
3 changed files with 26 additions and 13 deletions

View File

@@ -75,6 +75,18 @@ export function isIndexedDBAvailable(): boolean {
}
}
// Check if IndexedDB is actually usable (not just present).
export async function isIndexedDBUsable(): Promise<boolean> {
if (!isIndexedDBAvailable()) return false
try {
const db = await getDB()
db.close()
return true
} catch {
return false
}
}
// CRUD Operations
export async function getAllSessionMetadata(): Promise<SessionMetadata[]> {
if (!isIndexedDBAvailable()) return []