forked from MarseyWorld/MarseyWorld
dont remake search dictionary if its alrdy made
parent
0136b5b975
commit
9b03eb83b5
|
@ -253,6 +253,7 @@ function openEmojiModal(t, inputTargetIDName)
|
|||
switch (emojiEngineState) {
|
||||
case "inactive":
|
||||
emojiEngineState = "loading"
|
||||
if (searchDictionaryState == "inactive")
|
||||
makeEmojisSearchDictionary();
|
||||
return fetchEmojis();
|
||||
case "loading":
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
// tags dictionary. KEEP IT SORT
|
||||
let searchDictionaryState = "inactive";
|
||||
|
||||
class EmoijsDictNode
|
||||
{
|
||||
constructor(tag, name) {
|
||||
|
@ -6,6 +7,7 @@ class EmoijsDictNode
|
|||
this.emojiNames = [name];
|
||||
}
|
||||
}
|
||||
|
||||
const emojisSearchDictionary = {
|
||||
dict: [],
|
||||
|
||||
|
@ -85,6 +87,6 @@ function makeEmojisSearchDictionary() {
|
|||
emojisSearchDictionary.updateTag(emoji.tags[i], emoji.name);
|
||||
}
|
||||
|
||||
emojiSpeedEngineState = "ready";
|
||||
searchDictionaryState = "ready";
|
||||
})
|
||||
}
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
let emojiSpeedEngineState = "inactive";
|
||||
let emoji_typing_state = false;
|
||||
let globalEmojis;
|
||||
|
||||
|
@ -211,9 +210,9 @@ function insertGhostDivs(element) {
|
|||
|
||||
function openSpeedModal()
|
||||
{
|
||||
switch (emojiSpeedEngineState) {
|
||||
switch (searchDictionaryState) {
|
||||
case "inactive":
|
||||
emojiSpeedEngineState = "loading"
|
||||
searchDictionaryState = "loading"
|
||||
return makeEmojisSearchDictionary();
|
||||
case "loading":
|
||||
// this works because once the fetch completes, the first keystroke callback will fire and use the current value
|
||||
|
|
Loading…
Reference in New Issue