cancel snapshot update if one is in progress

Signed-off-by: randomhydrosol <randomhydrosol@glassrom.org>
This commit is contained in:
randomhydrosol 2022-11-13 03:56:21 +05:30 committed by Daniel Micay
parent e0b8a09b73
commit 135ebf5121

View File

@ -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) => {