This commit is contained in:
syuilo
2024-08-27 08:49:12 +09:00
parent d14b0e815c
commit 296b8ce24b
3 changed files with 15 additions and 5 deletions

View File

@@ -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 : []);