Fix emoji input menu not entering emojis

Problem was that we removed the parameter for the loadEmojis function
because we didn't do a full text search on the entire codebase to see
where it was actually used.

Also changed loading to reject the promise to ignore later keystrokes
while the modal is still loading.
pull/162/head
KindaCrayCray 2023-07-01 00:43:19 +02:00
parent 98a2ade30b
commit 33bc341466
1 changed files with 4 additions and 1 deletions

View File

@ -510,11 +510,13 @@ forms.forEach(i => {
i.addEventListener('keydown', speed_carot_navigate, false);
});
function loadEmojis()
function loadEmojis(inputTargetIDName)
{
selecting = false;
speed_carot_modal.style.display = "none";
if (inputTargetIDName) emojiInputTargetDOM = document.getElementById(inputTargetIDName);
switch (emojiEngineState) {
case "inactive":
emojiEngineState = "loading"
@ -522,6 +524,7 @@ function loadEmojis()
case "loading":
// this is a subpar solution because it means that globalEmojis won't be loaded for later keystrokes
// however, it doesn't matter because onInput only checks what the user is typing after everything is loaded
return Promise.reject();
case "ready":
return Promise.resolve();
default: