WebUI: use local preference class locally

This commit is contained in:
Chocobo1
2025-08-27 17:34:50 +08:00
parent 07f2afc4ac
commit b851caa6b9
11 changed files with 149 additions and 137 deletions

View File

@@ -182,10 +182,12 @@
}
};
const localPreferences = new window.qBittorrent.LocalPreferences.LocalPreferences();
let logFilterTimer = -1;
let inputtedFilterText = "";
let selectBox;
let selectedLogLevels = JSON.parse(LocalPreferences.get("qbt_selected_log_levels")) || ["1", "2", "4", "8"];
let selectedLogLevels = JSON.parse(localPreferences.get("qbt_selected_log_levels")) || ["1", "2", "4", "8"];
const init = () => {
for (const option of document.getElementById("logLevelSelect").options)
@@ -275,7 +277,7 @@
if (selectedLogLevels !== value) {
tableInfo[currentSelectedTab].last_id = -1;
selectedLogLevels = value;
LocalPreferences.set("qbt_selected_log_levels", JSON.stringify(selectedLogLevels));
localPreferences.set("qbt_selected_log_levels", JSON.stringify(selectedLogLevels));
logFilterChanged();
}
};