Fix emoji aliasing breaking when no such config is defined

pull/690/head
Zef Hemel 2024-02-06 17:20:31 +01:00
parent 11859a1d53
commit bfd8ef9cd2
1 changed files with 4 additions and 0 deletions

View File

@ -34,11 +34,15 @@ export function emojiCompleter({ linePrefix, pos }: CompleteEvent) {
} }
let lastConfigUpdate = 0; let lastConfigUpdate = 0;
async function updateConfig() { async function updateConfig() {
// Update at most every 5 seconds // Update at most every 5 seconds
if (Date.now() < lastConfigUpdate + 5000) return; if (Date.now() < lastConfigUpdate + 5000) return;
lastConfigUpdate = Date.now(); lastConfigUpdate = Date.now();
const config = await readSetting("emoji"); const config = await readSetting("emoji");
if (!config) {
return;
}
// This is simpler to write in SETTINGS and prevents duplicates, // This is simpler to write in SETTINGS and prevents duplicates,
// which could be supported but probably aren't user's intent // which could be supported but probably aren't user's intent