diff --git a/packages/app/src/runtime/persistence/drafts.ts b/packages/app/src/runtime/persistence/drafts.ts index 9d484bd55fc..be20a3d1d24 100644 --- a/packages/app/src/runtime/persistence/drafts.ts +++ b/packages/app/src/runtime/persistence/drafts.ts @@ -114,11 +114,12 @@ export function createBrowserDraftStore(): DraftStore { if (item?.blob && typeof item.blob.id === "string") used.add(item.blob.id) return item }) - const blobs = transaction.objectStore("blobs").openKeyCursor() + const store = transaction.objectStore("blobs") + const blobs = store.openKeyCursor() blobs.addEventListener("success", () => { const cursor = blobs.result if (!cursor) return - if (!used.has(String(cursor.key))) cursor.delete() + if (!used.has(String(cursor.key))) store.delete(cursor.key) cursor.continue() }) })