From 56954260c8d76b54331c2b1abbd120ded7cb2c99 Mon Sep 17 00:00:00 2001
From: Sainan <63328889+Sainan@users.noreply.github.com>
Date: Mon, 6 Oct 2025 22:55:46 -0700
Subject: [PATCH] chore(webui): debounce quest updates (#2858)
Closes #2855
Reviewed-on: https://onlyg.it/OpenWF/SpaceNinjaServer/pulls/2858
Co-authored-by: Sainan <63328889+Sainan@users.noreply.github.com>
Co-committed-by: Sainan <63328889+Sainan@users.noreply.github.com>
---
static/webui/script.js | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/static/webui/script.js b/static/webui/script.js
index c6400db7..734e6a1f 100644
--- a/static/webui/script.js
+++ b/static/webui/script.js
@@ -1202,7 +1202,7 @@ function updateInventory() {
a.href = "#";
a.onclick = function (event) {
event.preventDefault();
- doQuestUpdate("setInactive", item.ItemType);
+ debounce(doQuestUpdate, "setInactive", item.ItemType);
};
a.title = loc("code_setInactive");
a.innerHTML = ``;
@@ -1213,7 +1213,7 @@ function updateInventory() {
a.href = "#";
a.onclick = function (event) {
event.preventDefault();
- doQuestUpdate("resetKey", item.ItemType);
+ debounce(doQuestUpdate, "resetKey", item.ItemType);
};
a.title = loc("code_reset");
a.innerHTML = ``;
@@ -1224,7 +1224,7 @@ function updateInventory() {
a.href = "#";
a.onclick = function (event) {
event.preventDefault();
- doQuestUpdate("completeKey", item.ItemType);
+ debounce(doQuestUpdate, "completeKey", item.ItemType);
};
a.title = loc("code_complete");
a.innerHTML = ``;
@@ -1235,7 +1235,7 @@ function updateInventory() {
a.href = "#";
a.onclick = function (event) {
event.preventDefault();
- doQuestUpdate("prevStage", item.ItemType);
+ debounce(doQuestUpdate, "prevStage", item.ItemType);
};
a.title = loc("code_prevStage");
a.innerHTML = ``;
@@ -1250,7 +1250,7 @@ function updateInventory() {
a.href = "#";
a.onclick = function (event) {
event.preventDefault();
- doQuestUpdate("nextStage", item.ItemType);
+ debounce(doQuestUpdate, "nextStage", item.ItemType);
};
a.title = loc("code_nextStage");
a.innerHTML = ``;
@@ -1262,7 +1262,7 @@ function updateInventory() {
a.onclick = function (event) {
event.preventDefault();
reAddToItemList(itemMap, "QuestKeys", item.ItemType);
- doQuestUpdate("deleteKey", item.ItemType);
+ debounce(doQuestUpdate, "deleteKey", item.ItemType);
};
a.title = loc("code_remove");
a.innerHTML = ``;