fix(studio): let the session photo outlive a reload again

This commit is contained in:
2026-10-12 09:50:18 +07:00
parent 2f6681851e
commit 934a3aa056
+6 -1
View File
@@ -59,9 +59,14 @@ export function saveState(state: StudioState): void {
}
// --- the photo: IndexedDB, because a 12MP JPEG does not fit in localStorage ---
// The version is not this file's to name: the frame store shares this database
// and raises it (see `customFrame.ts`, which adds `custom_frames` and keeps this
// store on the way). Asking for a number of our own is a gate we fail at the
// moment the other store has gone past it — `VersionError`, on every read and
// every write, and a session photo that silently never survives a reload.
function openDb(): Promise<IDBDatabase> {
return new Promise((resolve, reject) => {
const req = indexedDB.open(DB_NAME, 1);
const req = indexedDB.open(DB_NAME);
req.onupgradeneeded = () => req.result.createObjectStore(STORE);
req.onsuccess = () => resolve(req.result);
req.onerror = () => reject(req.error);