mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-05 13:27:49 +08:00
improved loadWordsHistory() performance by batching appends
This commit is contained in:
parent
2cfe0fb2ff
commit
b34ed3f22b
1 changed files with 3 additions and 1 deletions
|
@ -3106,6 +3106,7 @@ function toggleResultWordsDisplay() {
|
|||
|
||||
async function loadWordsHistory() {
|
||||
$("#resultWordsHistory .words").empty();
|
||||
let wordsHTML = "";
|
||||
for (let i = 0; i < inputHistory.length + 2; i++) {
|
||||
let input = inputHistory[i];
|
||||
let wordEl = "";
|
||||
|
@ -3216,8 +3217,9 @@ async function loadWordsHistory() {
|
|||
wordEl += "</div>";
|
||||
} catch (e) {}
|
||||
}
|
||||
$("#resultWordsHistory .words").append(wordEl);
|
||||
wordsHTML += wordEl;
|
||||
}
|
||||
$("#resultWordsHistory .words").html(wordsHTML);
|
||||
$("#showWordHistoryButton").addClass("loaded");
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue