|
|
|
|
@ -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; |
|
|
|
|
|