mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-19 06:57:24 -06:00
WebUI: use native function to convert to numbers
Also replace `parseInt()` since `Number()` behavior is more intuitive. PR #21831.
This commit is contained in:
@@ -197,7 +197,7 @@ window.qBittorrent.PropFiles ??= (() => {
|
||||
|
||||
const updatePriorityCombo = (id, selectedPriority) => {
|
||||
const combobox = $("comboPrio" + id);
|
||||
if (parseInt(combobox.value, 10) !== selectedPriority)
|
||||
if (Number(combobox.value) !== selectedPriority)
|
||||
selectComboboxPriority(combobox, selectedPriority);
|
||||
};
|
||||
|
||||
@@ -205,7 +205,7 @@ window.qBittorrent.PropFiles ??= (() => {
|
||||
const options = combobox.options;
|
||||
for (let i = 0; i < options.length; ++i) {
|
||||
const option = options[i];
|
||||
if (parseInt(option.value, 10) === priority)
|
||||
if (Number(option.value) === priority)
|
||||
option.selected = true;
|
||||
else
|
||||
option.selected = false;
|
||||
|
||||
Reference in New Issue
Block a user