From 4cc35e56d9f4217876fb589fa025ab41f2daaa0c Mon Sep 17 00:00:00 2001 From: ThaUnknown <6506529+ThaUnknown@users.noreply.github.com> Date: Sun, 19 Oct 2025 03:01:56 +0200 Subject: [PATCH] fix: offline cache not working --- package.json | 2 +- src/lib/modules/anilist/storage.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 0b43b66..bcef948 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ui", - "version": "6.4.158", + "version": "6.4.159", "license": "BUSL-1.1", "private": true, "packageManager": "pnpm@9.15.5", diff --git a/src/lib/modules/anilist/storage.ts b/src/lib/modules/anilist/storage.ts index 1c5399d..e502bf1 100644 --- a/src/lib/modules/anilist/storage.ts +++ b/src/lib/modules/anilist/storage.ts @@ -140,6 +140,7 @@ export const makeDefaultStorage = (opts?: StorageOptions): DefaultStorage => { }, readData (): Promise { + const data = Object.create(null) return database$ .then(database => { const transaction = database.transaction( @@ -159,6 +160,7 @@ export const makeDefaultStorage = (opts?: StorageOptions): DefaultStorage => { const request = store.get(key) request.onsuccess = () => { 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) }) .then( - () => batch, + () => data, () => batch ) },