Emoji: Cache data by path instead of just Etag (#37858)
This commit is contained in:
7 files changed
+85
-114
No files matched your search
@@ -7,7 +7,7 @@ export async function importCustomEmoji(emojis: ApiCustomEmojiJSON[]) {
|
||||
}
|
||||
|
||||
// First, check if we already have them all.
|
||||
const { searchCustomEmojisByShortcodes, clearEtag } =
|
||||
const { searchCustomEmojisByShortcodes, clearCache } =
|
||||
await import('@/mastodon/features/emoji/database');
|
||||
|
||||
const existingEmojis = await searchCustomEmojisByShortcodes(
|
||||
@@ -16,7 +16,7 @@ export async function importCustomEmoji(emojis: ApiCustomEmojiJSON[]) {
|
||||
|
||||
// If there's a mismatch, re-import all custom emojis.
|
||||
if (existingEmojis.length < emojis.length) {
|
||||
await clearEtag('custom');
|
||||
await clearCache('custom');
|
||||
await loadCustomEmoji();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user