From c37ea654aec1612cffd2d90caca7d5e7a01cb963 Mon Sep 17 00:00:00 2001 From: Alec Blance <17378596+AlecBlance@users.noreply.github.com> Date: Fri, 25 Oct 2024 23:31:27 +0800 Subject: [PATCH] fix: :bug: stored buckets are cleared after some time Returning storage data instead of the storage object which results to undefined when we destructure it in https://github.com/AlecBlance/S3BucketList/blob/329bb1da33caf299fc49b5e39916cf84949177df/src/background.ts#L25 fixes #22 --- src/utils/helper.utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/helper.utils.ts b/src/utils/helper.utils.ts index 3a29c74..678ac60 100644 --- a/src/utils/helper.utils.ts +++ b/src/utils/helper.utils.ts @@ -17,7 +17,7 @@ export const getStorageKeyValue = async >( new Promise((resolve) => chrome.storage.local.get(storageKey).then((result) => { if (!Object.keys(result).length) return resolve({} as T); - if (!keys) return resolve(result[storageKey] as T); + if (!keys) return resolve(result as T); resolve( keys.reduce( (accu, key) => ({ ...accu, [key]: result[storageKey][key] }),