wip
This commit is contained in:
@@ -5,8 +5,17 @@
|
||||
|
||||
import { shallowRef, computed, markRaw, watch } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { misskeyApi, misskeyApiGet } from '@/scripts/misskey-api.js';
|
||||
import { get, set } from '@/scripts/idb-proxy.js';
|
||||
import { misskeyApi, misskeyApiGet } from '@/misskey-api.js';
|
||||
|
||||
function get(key: string) {
|
||||
const value = localStorage.getItem(key);
|
||||
if (value === null) return null;
|
||||
return JSON.parse(value);
|
||||
}
|
||||
|
||||
function set(key: string, value: any) {
|
||||
localStorage.setItem(key, JSON.stringify(value));
|
||||
}
|
||||
|
||||
const storageCache = await get('emojis');
|
||||
export const customEmojis = shallowRef<Misskey.entities.EmojiSimple[]>(Array.isArray(storageCache) ? storageCache : []);
|
||||
|
Reference in New Issue
Block a user