From 4ec9e0a0d8cf3e1ff42d1bc74797c8ca4c0cc0e5 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Tue, 7 May 2019 06:50:52 -0400 Subject: [PATCH] generalize code avoiding links to snapshot tags --- static/releases.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/static/releases.js b/static/releases.js index f807a31c..c48bd8f6 100644 --- a/static/releases.js +++ b/static/releases.js @@ -3,6 +3,7 @@ const baseUrl = "https://seamlessupdate.app/"; const versionBaseUrl = "https://github.com/GrapheneOS/platform_manifest/releases/tag/"; const devices = ["crosshatch", "blueline", "taimen", "walleye", "marlin", "sailfish"]; +const snapshot = ["marlin", "sailfish"]; const channels = ["stable", "beta"]; function createLink(href, text) { @@ -61,11 +62,11 @@ for (const channel of channels) { const tag = metadata[2] + "." + metadata[0]; const version = document.createElement("p"); - if (device !== "marlin" && device !== "sailfish") { + if (snapshot.includes(device)) { + version.appendChild(document.createTextNode("Version: " + tag)); + } else { version.appendChild(document.createTextNode("Version: ")); version.appendChild(createLink(versionBaseUrl + tag, tag)); - } else { - version.appendChild(document.createTextNode("Version: " + tag)); } release.appendChild(version);