actually fix perf

main
easrng 2022-02-18 14:21:54 -05:00
parent 98e1393441
commit ae87f2abe0
1 changed files with 2 additions and 2 deletions

View File

@ -57,10 +57,10 @@ const setupChatboxEvents = (socket) => {
}; };
let results = await findEmojis(search); let results = await findEmojis(search);
let yieldAt = performance.now() + 13; let yieldAt = performance.now() + 13;
for (let i = 0; i < results.length; i += 10) { for (let i = 0; i < results.length; i += 100) {
emojiAutocomplete.append.apply( emojiAutocomplete.append.apply(
emojiAutocomplete, emojiAutocomplete,
results.slice(i, i + 1000).map(([name, replaceWith, ext], i) => { results.slice(i, i + 100).map(([name, replaceWith, ext], i) => {
const button = Object.assign(document.createElement("button"), { const button = Object.assign(document.createElement("button"), {
className: "emoji-option", className: "emoji-option",
onmousedown: (e) => e.preventDefault(), onmousedown: (e) => e.preventDefault(),