enhance(frontend): cache user lists / antennas
This commit is contained in:
@@ -30,6 +30,8 @@ type Keys =
|
||||
'message_drafts' |
|
||||
'scratchpad' |
|
||||
'debug' |
|
||||
'userListsCache' |
|
||||
'antennasCache' |
|
||||
`miux:${string}` |
|
||||
`ui:folder:${string}` |
|
||||
`themes:${string}` |
|
||||
@@ -41,4 +43,12 @@ export const miLocalStorage = {
|
||||
getItem: (key: Keys): string | null => window.localStorage.getItem(key),
|
||||
setItem: (key: Keys, value: string): void => window.localStorage.setItem(key, value),
|
||||
removeItem: (key: Keys): void => window.localStorage.removeItem(key),
|
||||
getItemAsJson: (key: Keys): any | undefined => {
|
||||
const item = miLocalStorage.getItem(key);
|
||||
if (item === null) {
|
||||
return undefined;
|
||||
}
|
||||
return JSON.parse(item);
|
||||
},
|
||||
setItemAsJson: (key: Keys, value: any): void => window.localStorage.setItem(key, JSON.stringify(value)),
|
||||
};
|
||||
|
Reference in New Issue
Block a user