Merge remote-tracking branch 'misskey/master' into feature/2024.9.0
This commit is contained in:
commit
f00576bce6
564 changed files with 19993 additions and 8169 deletions
|
|
@ -3,7 +3,7 @@
|
|||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
type Keys =
|
||||
export type Keys =
|
||||
'v' |
|
||||
'lastVersion' |
|
||||
'instance' |
|
||||
|
|
@ -39,12 +39,22 @@ type Keys =
|
|||
`aiscript:${string}` |
|
||||
'lastEmojisFetchedAt' | // DEPRECATED, stored in indexeddb (13.9.0~)
|
||||
'emojis' | // DEPRECATED, stored in indexeddb (13.9.0~);
|
||||
`channelLastReadedAt:${string}`
|
||||
`channelLastReadedAt:${string}` |
|
||||
`idbfallback::${string}`
|
||||
|
||||
// セッション毎に廃棄されるLocalStorage代替(セーフモードなどで使用できそう)
|
||||
//const safeSessionStorage = new Map<Keys, string>();
|
||||
|
||||
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),
|
||||
getItem: (key: Keys): string | null => {
|
||||
return 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) {
|
||||
|
|
@ -52,5 +62,7 @@ export const miLocalStorage = {
|
|||
}
|
||||
return JSON.parse(item);
|
||||
},
|
||||
setItemAsJson: (key: Keys, value: any): void => window.localStorage.setItem(key, JSON.stringify(value)),
|
||||
setItemAsJson: (key: Keys, value: any): void => {
|
||||
miLocalStorage.setItem(key, JSON.stringify(value));
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue