Fix - Do not spam saveSettingsDebounced setting an item in AccountStorage (#5090)

925ee10560f15dcfebdc97e725e6cc5b51c27aa8

Leandro Jofré <leandrotomasjofre@gmail.com>

Signed
1 files changed, +6 -0Showing whitespace changes
public/scripts/util/AccountStorage.js+6 -0
@@ -103,6 +103,12 @@ class AccountStorage {
103103 console.warn(`AccountStorage not ready (trying to write to ${key})`);
104104 }
105105
106+ const hasPropertySet = Object.hasOwn(this.#state, key) && this.#state[key] === String(value);
107+
108+ if (hasPropertySet) {
109+ return;
110+ }
111+
106112 this.#state[key] = String(value);
107113 saveSettingsDebounced();
108114 }