From d243a24755c2906c27ae2618b6ec95237b985cf5 Mon Sep 17 00:00:00 2001 From: Asizon <43983086+Asizon@users.noreply.github.com> Date: Sun, 13 Dec 2020 08:40:57 +0100 Subject: [PATCH] Improve conditionals --- src/js/tabs/firmware_flasher.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/js/tabs/firmware_flasher.js b/src/js/tabs/firmware_flasher.js index ae426a99..5edb68d4 100644 --- a/src/js/tabs/firmware_flasher.js +++ b/src/js/tabs/firmware_flasher.js @@ -1021,12 +1021,14 @@ TABS.firmware_flasher.initialize = function (callback) { }); portPickerElement.change(function () { - if ($('option:selected', this).data().isDFU && !GUI.connect_lock) { - exitDfuElement.removeClass('disabled'); - } else if (!GUI.connect_lock) { - $("a.load_remote_file").removeClass('disabled'); - $("a.load_file").removeClass('disabled'); - exitDfuElement.addClass('disabled'); + if (!GUI.connect_lock) { + if ($('option:selected', this).data().isDFU) { + exitDfuElement.removeClass('disabled'); + } else { + $("a.load_remote_file").removeClass('disabled'); + $("a.load_file").removeClass('disabled'); + exitDfuElement.addClass('disabled'); + } } }).change();