fix: offline cache not working
Some checks failed
Check / check (push) Has been cancelled

This commit is contained in:
ThaUnknown 2025-10-19 03:01:56 +02:00
parent 8d71c5bff3
commit 4cc35e56d9
No known key found for this signature in database
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{ {
"name": "ui", "name": "ui",
"version": "6.4.158", "version": "6.4.159",
"license": "BUSL-1.1", "license": "BUSL-1.1",
"private": true, "private": true,
"packageManager": "pnpm@9.15.5", "packageManager": "pnpm@9.15.5",

View file

@ -140,6 +140,7 @@ export const makeDefaultStorage = (opts?: StorageOptions): DefaultStorage => {
}, },
readData (): Promise<SerializedEntries> { readData (): Promise<SerializedEntries> {
const data = Object.create(null)
return database$ return database$
.then(database => { .then(database => {
const transaction = database.transaction( const transaction = database.transaction(
@ -159,6 +160,7 @@ export const makeDefaultStorage = (opts?: StorageOptions): DefaultStorage => {
const request = store.get(key) const request = store.get(key)
request.onsuccess = () => { request.onsuccess = () => {
if (key === timestamp) { Object.assign(batch, request.result) } if (key === timestamp) { Object.assign(batch, request.result) }
Object.assign(data, request.result)
} }
} }
@ -169,7 +171,7 @@ export const makeDefaultStorage = (opts?: StorageOptions): DefaultStorage => {
return getTransactionPromise(transaction) return getTransactionPromise(transaction)
}) })
.then( .then(
() => batch, () => data,
() => batch () => batch
) )
}, },