From dfc1ed2fa958816d46f391d52f2847faa7f456d0 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Fri, 1 May 2026 18:52:37 +0200 Subject: [PATCH] auto-git: [change] src/serialization/editor-draft-storage.ts --- src/serialization/editor-draft-storage.ts | 24 ++++------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/src/serialization/editor-draft-storage.ts b/src/serialization/editor-draft-storage.ts index 536a7d6c..03119bbf 100644 --- a/src/serialization/editor-draft-storage.ts +++ b/src/serialization/editor-draft-storage.ts @@ -65,13 +65,6 @@ interface EditorViewportDraftRecord { viewportLayoutState: ViewportLayoutState; } -interface IndexedDbRequestLike { - result: T; - error: DOMException | null; - onsuccess: ((event: Event) => void) | null; - onerror: ((event: Event) => void) | null; -} - function getErrorDetail(error: unknown): string { if (error instanceof Error && error.message.trim().length > 0) { return error.message.trim(); @@ -288,8 +281,9 @@ export class IndexedDbEditorDraftStorage implements EditorDraftStorage { "readonly" ); const store = transaction.objectStore(EDITOR_DRAFT_OBJECT_STORE); + const done = transactionDone(transaction); const result = await requestToPromise(store.get(key)); - await transactionDone(transaction); + await done; return result; } @@ -299,9 +293,10 @@ export class IndexedDbEditorDraftStorage implements EditorDraftStorage { "readwrite" ); const store = transaction.objectStore(EDITOR_DRAFT_OBJECT_STORE); + const done = transactionDone(transaction); store.put(value, key); - await transactionDone(transaction); + await done; } private loadLegacyDraft(): EditorDraftLoadResult { @@ -556,14 +551,3 @@ export async function loadOrCreateEditorDraft( }; } } - -export function createResolvedIndexedDbRequest( - result: T -): IndexedDbRequestLike { - return { - result, - error: null, - onsuccess: null, - onerror: null - }; -}