Skip to content

Commit

Permalink
WebUI: fix checkbox initialization
Browse files Browse the repository at this point in the history
Previously the checkbox had all options checked regardless of the stored
setting.
  • Loading branch information
Chocobo1 committed Nov 25, 2024
1 parent 48874d3 commit 9bb9f8e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/webui/www/private/views/log.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@
let selectedLogLevels = JSON.parse(LocalPreferences.get("qbt_selected_log_levels")) || ["1", "2", "4", "8"];

const init = () => {
for (const option of $("logLevelSelect").options)
option.setAttribute("selected", selectedLogLevels.includes(option.value));
for (const option of $("logLevelSelect").options) {
if (selectedLogLevels.includes(option.value)) // set `false` will break the UI
option.setAttribute("selected", true);
}

selectBox = new vanillaSelectBox("#logLevelSelect", {
maxHeight: 200,
Expand Down

0 comments on commit 9bb9f8e

Please sign in to comment.