mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-24 06:33:01 -04:00
fix(app): use a deletable cursor for draft blob cleanup (#44594)
Co-authored-by: Brendan Allan <git@brendonovich.dev>
This commit is contained in:
@@ -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()
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user