fix(studio): let the session photo outlive a reload again
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user