Skip to content

Commit

Permalink
fix: 🐛 stored buckets are cleared after some time
Browse files Browse the repository at this point in the history
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
  • Loading branch information
AlecBlance committed Oct 25, 2024
1 parent 329bb1d commit c37ea65
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/helper.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const getStorageKeyValue = async <T = Record<string, any>>(
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] }),
Expand Down

0 comments on commit c37ea65

Please sign in to comment.