Skip to content

Commit

Permalink
Reorder code to match UI
Browse files Browse the repository at this point in the history
  • Loading branch information
sledgehammer999 committed Nov 1, 2024
1 parent 2545de0 commit 4ab3218
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/webui/www/private/views/preferences.html
Original file line number Diff line number Diff line change
Expand Up @@ -2154,6 +2154,10 @@
window.parent.qBittorrent.Cache.preferences.init({
onSuccess: (pref) => {
// Behavior tab
// Language
updateWebuiLocaleSelect(pref.locale);
updateColoSchemeSelect();
$("performanceWarning").checked = pref.performance_warning;
document.getElementById("displayFullURLTrackerColumn").checked = (LocalPreferences.get("full_url_tracker_column", "false") === "true");
document.getElementById("hideZeroFiltersCheckbox").checked = (LocalPreferences.get("hide_zero_status_filters", "false") === "true");
$("dblclickDownloadSelect").value = LocalPreferences.get("dblclick_download", "1");
Expand Down Expand Up @@ -2439,11 +2443,6 @@
$("rss_filter_textarea").value = pref.rss_smart_episode_filters;

// WebUI tab
// Language
updateWebuiLocaleSelect(pref.locale);
updateColoSchemeSelect();
$("performanceWarning").checked = pref.performance_warning;

// HTTP Server
$("webui_domain_textarea").value = pref.web_ui_domain_list;
$("webui_address_value").value = pref.web_ui_address;
Expand Down Expand Up @@ -2574,6 +2573,16 @@
// Validate form data

// Behavior tab
// Language
settings["locale"] = $("locale_select").value;
const colorScheme = Number(document.getElementById("colorSchemeSelect").value);
if (colorScheme === 0)
LocalPreferences.remove("color_scheme");
else if (colorScheme === 1)
LocalPreferences.set("color_scheme", "light");
else
LocalPreferences.set("color_scheme", "dark");
settings["performance_warning"] = $("performanceWarning").checked;
LocalPreferences.set("full_url_tracker_column", document.getElementById("displayFullURLTrackerColumn").checked.toString());
LocalPreferences.set("hide_zero_status_filters", document.getElementById("hideZeroFiltersCheckbox").checked.toString());
LocalPreferences.set("dblclick_download", $("dblclickDownloadSelect").value);
Expand Down Expand Up @@ -2866,17 +2875,6 @@
settings["rss_smart_episode_filters"] = $("rss_filter_textarea").value;

// WebUI tab
// Language
settings["locale"] = $("locale_select").value;
const colorScheme = Number(document.getElementById("colorSchemeSelect").value);
if (colorScheme === 0)
LocalPreferences.remove("color_scheme");
else if (colorScheme === 1)
LocalPreferences.set("color_scheme", "light");
else
LocalPreferences.set("color_scheme", "dark");
settings["performance_warning"] = $("performanceWarning").checked;

// HTTP Server
settings["web_ui_domain_list"] = $("webui_domain_textarea").value;
const web_ui_address = $("webui_address_value").value.toString();
Expand Down

0 comments on commit 4ab3218

Please sign in to comment.