You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* eslint-disable security-node/detect-crlf */import{StateStorage}from'zustand/middleware';exportconstgetExtensionStorage=(storageName: string): StateStorage=>({getItem: async(key: string): Promise<string|null>=>{console.log(key,`has been retrieved in ${storageName}`);constresult=awaitchrome.storage.sync.get(`${storageName}-${key}`);returnresult[`${storageName}-${key}`]asstring|null;},setItem: async(key: string,value: string): Promise<void>=>{console.log(key,'with value',value,`has been saved in ${storageName}`);awaitchrome.storage.sync.set({[`${storageName}-${key}`]: value});},removeItem: async(key: string): Promise<void>=>{console.log(key,`has been deleted from ${storageName}`);awaitchrome.storage.sync.remove(`${storageName}-${key}`);},});
Otherwise I found settings disappear after a while.
The text was updated successfully, but these errors were encountered:
I suggest use this:
and
Otherwise I found settings disappear after a while.
The text was updated successfully, but these errors were encountered: