Echo 0d54a47ec3 [Glitch] Emoji Rendering Efficiency
Port 6bca52453af3a4e76063e28e797f5e5b45ba74aa to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2025-08-01 22:17:21 +02:00

19 lines
507 B
TypeScript

import { importEmojiData, importCustomEmojiData } from './loader';
addEventListener('message', handleMessage);
self.postMessage('ready'); // After the worker is ready, notify the main thread
function handleMessage(event: MessageEvent<string>) {
const { data: locale } = event;
void loadData(locale);
}
async function loadData(locale: string) {
if (locale !== 'custom') {
await importEmojiData(locale);
} else {
await importCustomEmojiData();
}
self.postMessage(`loaded ${locale}`);
}