何らかの理由によりクライアントの絵文字キャッシュが削除された場合ただちに再取得するように修正 (MisskeyIO#163)
This commit is contained in:
@@ -7,7 +7,7 @@ import { shallowRef, computed, markRaw, watch } from 'vue';
|
||||
import * as Misskey from 'misskey-js';
|
||||
import { api, apiGet } from './os';
|
||||
import { useStream } from '@/stream';
|
||||
import { get, set } from '@/scripts/idb-proxy';
|
||||
import { get, set, exist } from '@/scripts/idb-proxy';
|
||||
|
||||
const storageCache = await get('emojis');
|
||||
export const customEmojis = shallowRef<Misskey.entities.CustomEmoji[]>(Array.isArray(storageCache) ? storageCache : []);
|
||||
@@ -54,8 +54,9 @@ export async function fetchCustomEmojis(force = false) {
|
||||
if (force) {
|
||||
res = await api('emojis', {});
|
||||
} else {
|
||||
const emojiCacheExist = await exist('emojis');
|
||||
const lastFetchedAt = await get('lastEmojisFetchedAt');
|
||||
if (lastFetchedAt && (now - lastFetchedAt) < 1000 * 60 * 60) return;
|
||||
if (lastFetchedAt && (now - lastFetchedAt) < 1000 * 60 * 60 && emojiCacheExist) return;
|
||||
res = await apiGet('emojis', {});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user