From 135ebf512171641c9488c6fae2d3c45b3928343e Mon Sep 17 00:00:00 2001 From: randomhydrosol Date: Sun, 13 Nov 2022 03:56:21 +0530 Subject: [PATCH] cancel snapshot update if one is in progress Signed-off-by: randomhydrosol --- static/js/web-install.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/static/js/web-install.js b/static/js/web-install.js index 66df4314..4e598474 100644 --- a/static/js/web-install.js +++ b/static/js/web-install.js @@ -213,8 +213,13 @@ async function flashRelease(setProgress) { throw new Error("You need to download a release first!"); } - setProgress("Flashing release..."); safeToLeave = false; + + // If the user didn't follow the update instructions correctly + setProgress("Cancelling any update in progress..."); + await device.runCommand("snapshot-update:cancel"); + + setProgress("Flashing release..."); try { await device.flashFactoryZip(blob, true, reconnectCallback, (action, item, progress) => {