From 1636983d1f20df496e130955f239e30f7dd67fea Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Wed, 14 Jul 2021 02:11:15 -0400 Subject: [PATCH] add supported device check for web install fetch --- static/js/web-install.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/js/web-install.js b/static/js/web-install.js index 838dd6d6..07b89b4e 100644 --- a/static/js/web-install.js +++ b/static/js/web-install.js @@ -140,8 +140,13 @@ async function unlockBootloader(setProgress) { return "Bootloader unlocked."; } +const supportedDevices = ["redfin", "bramble", "sunfish", "coral", "flame", "bonito", "sargo", "crosshatch", "blueline"]; + async function getLatestRelease() { let product = await device.getVariable("product"); + if (!supportedDevices.includes(product)) { + throw new Error(`device model (${product}) is not supported by the GrapheneOS web installer`); + } let metadataResp = await fetch(`${RELEASES_URL}/${product}-stable`); let metadata = await metadataResp.text();