From 307a882649691f2d816e8178a6df4a142f4932af Mon Sep 17 00:00:00 2001 From: syuilo Date: Sat, 21 Jan 2023 20:53:11 +0900 Subject: [PATCH] tweak fetchCustomEmojis timing --- packages/frontend/src/custom-emojis.ts | 2 -- packages/frontend/src/init.ts | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/custom-emojis.ts b/packages/frontend/src/custom-emojis.ts index 637ee9c06e..a7ac4e03ca 100644 --- a/packages/frontend/src/custom-emojis.ts +++ b/packages/frontend/src/custom-emojis.ts @@ -9,8 +9,6 @@ export let customEmojis: { url: string; }[] = storageCache ? JSON.parse(storageCache) : []; -fetchCustomEmojis(); - export async function fetchCustomEmojis() { const now = Date.now(); const lastFetchedAt = miLocalStorage.getItem('lastEmojisFetchedAt'); diff --git a/packages/frontend/src/init.ts b/packages/frontend/src/init.ts index d90d3b5532..079003ee83 100644 --- a/packages/frontend/src/init.ts +++ b/packages/frontend/src/init.ts @@ -45,6 +45,7 @@ import { getUrlWithoutLoginId } from '@/scripts/login-id'; import { getAccountFromId } from '@/scripts/get-account-from-id'; import { miLocalStorage } from './local-storage'; import { claimAchievement, claimedAchievements } from './scripts/achievements'; +import { fetchCustomEmojis } from './custom-emojis'; (async () => { console.info(`Misskey v${version}`); @@ -178,6 +179,10 @@ import { claimAchievement, claimedAchievements } from './scripts/achievements'; initializeSw(); }); + try { + await fetchCustomEmojis(); + } catch (err) {} + const app = createApp( window.location.search === '?zen' ? defineAsyncComponent(() => import('@/ui/zen.vue')) : !$i ? defineAsyncComponent(() => import('@/ui/visitor.vue')) :