summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflawedworld <flawedworld@flawed.world>2023-01-09 21:33:31 +0000
committerDaniel Micay <danielmicay@gmail.com>2023-01-09 16:55:45 -0500
commitc248a841b9224d1fdabc495b4c40bf5636dd425f (patch)
tree92e01a72579964d0e2e15f4b29482e803e4d261b
parentf95fd6bc2de6ffd51cecdb135a1009102210867b (diff)
Cancel snapshots on devices which are always capable of doing so
-rw-r--r--static/js/web-install.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/static/js/web-install.js b/static/js/web-install.js
index 957c4131..5fa4da41 100644
--- a/static/js/web-install.js
+++ b/static/js/web-install.js
@@ -148,6 +148,8 @@ const legacyQualcommDevices = ["sunfish", "coral", "flame", "bonito", "sargo", "
const tensorDevices = ["cheetah", "panther", "bluejay", "raven", "oriole"];
+const day1SnapshotCancelDevices = ["cheetah", "panther", "bluejay", "raven", "oriole", "barbet", "redfin", "bramble"];
+
async function getLatestRelease() {
let product = await device.getVariable("product");
if (!supportedDevices.includes(product)) {
@@ -213,6 +215,15 @@ async function flashRelease(setProgress) {
throw new Error("You need to download a release first!");
}
+ setProgress("Cancelling any pending OTAs...");
+ // Cancel snapshot update if in progress on devices which support it on all bootloader versions
+ if (day1SnapshotCancelDevices.includes(product)) {
+ let snapshotStatus = await device.getVariable("snapshot-update-status");
+ if (snapshotStatus !== null && snapshotStatus !== "none") {
+ await device.runCommand("snapshot-update:cancel");
+ }
+ }
+
setProgress("Flashing release...");
safeToLeave = false;
try {