mirror of
https://github.com/glitch-soc/mastodon.git
synced 2026-03-29 03:00:33 +02:00
duplicate fix from #37858
This commit is contained in:
@@ -21,10 +21,19 @@ export async function importEmojiData(localeString: string, path?: string) {
|
||||
path ??= await localeToPath(locale);
|
||||
}
|
||||
|
||||
// Fix from #37858. Check if we've loaded this path before.
|
||||
const existing = await loadLatestEtag(locale);
|
||||
if (existing === path) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const emojis = await fetchAndCheckEtag<CompactEmoji[]>(locale, path);
|
||||
if (!emojis) {
|
||||
return;
|
||||
}
|
||||
|
||||
await putLatestEtag(path, locale); // Fix from #37858. Put the path as the ETag to ensure we don't load the same data again.
|
||||
|
||||
const flattenedEmojis: FlatCompactEmoji[] = flattenEmojiData(emojis);
|
||||
await putEmojiData(flattenedEmojis, locale);
|
||||
return flattenedEmojis;
|
||||
|
||||
Reference in New Issue
Block a user