From d8e29b419b49f8620789b5abd912f50b6c5a90bc Mon Sep 17 00:00:00 2001 From: Paul Kendall Date: Sun, 29 Oct 2023 09:58:26 +1300 Subject: [PATCH] Minor UI fixes --- src/js/index.js | 6 +++--- src/js/xmodem.js | 7 +------ 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/js/index.js b/src/js/index.js index fec6b2c..3287bb5 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -712,7 +712,7 @@ flashButton.onclick = async (e) => { text: 'Firmware upload complete' }) } catch (e) { - errorHandler(e.message) + return errorHandler(e.message) } finally { closeDevice() } @@ -818,7 +818,7 @@ function errorHandler (msg) { _('status').innerHTML = '' _('progressBar').value = 0 mui.overlay('off') - SwalMUI.fire({ + return SwalMUI.fire({ icon: 'error', title: 'Update Failed', html: msg @@ -829,7 +829,7 @@ function abortHandler (event) { _('status').innerHTML = '' _('progressBar').value = 0 mui.overlay('off') - SwalMUI.fire({ + return SwalMUI.fire({ icon: 'info', title: 'Update Aborted', html: event.target.responseText diff --git a/src/js/xmodem.js b/src/js/xmodem.js index c880cae..450fa19 100644 --- a/src/js/xmodem.js +++ b/src/js/xmodem.js @@ -269,12 +269,7 @@ class XmodemFlasher { while (!gotBootloader) { currAttempt++ if (currAttempt > 10) { - await SwalMUI.fire({ - icon: 'error', - title: 'Flashing Failed', - text: 'Failed to enter bootloader mode in a reasonable time' - }) - throw new Error('[FAILED] to get to BL in reasonable time') + throw new Error('Failed to enter bootloader mode in a reasonable time') } this.log(`[${currAttempt}] retry...`)