From 73347d557e8de390cf10ee3389bffa3cd4438c3d Mon Sep 17 00:00:00 2001 From: Alyxia Sother Date: Fri, 22 Apr 2022 22:09:35 +0200 Subject: [PATCH] Skip updater if running development version --- .github/workflows/dev.yml | 4 ---- src/content/splash.html | 33 +++++++++++++++++++-------------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/.github/workflows/dev.yml b/.github/workflows/dev.yml index 9dffc80..3172783 100644 --- a/.github/workflows/dev.yml +++ b/.github/workflows/dev.yml @@ -28,8 +28,6 @@ jobs: - name: Replace the version number run: cat src/utils.ts | sed -e 's/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/DEV/g' | tee src/utils.ts > /dev/null - - run: cat src/utils.ts - - name: Build run: npm run build && electron-builder --linux zip && electron-builder --arm64 --linux zip @@ -64,8 +62,6 @@ jobs: - name: Replace the version number run: cat src/utils.ts | sed -e 's/[[:digit:]]\.[[:digit:]]\.[[:digit:]]/DEV/g' | tee src/utils.ts > /dev/null - - run: cat src/utils.ts - - name: Build run: npm run build && electron-builder --macos zip env: diff --git a/src/content/splash.html b/src/content/splash.html index 118d8d9..83cd134 100644 --- a/src/content/splash.html +++ b/src/content/splash.html @@ -22,20 +22,25 @@ text.innerHTML = "You appear to be offline. Please connect to the internet and try again."; } else { text.innerHTML = "Starting ArmCord..."; - fetch("https://armcord.xyz/latest.json") - .then((response) => response.json()) - .then((data) => { - if (data.version !== window.armcord.version) { - var elem = document.createElement("img"); - elem.classList.add("logo"); - elem.src = "https://armcord.smartfridge.space/update.webp"; - document.body.prepend(elem); - document.getElementById("splashscreen-armcord").remove(); - text.innerHTML = "A new version of ArmCord is available. Please update to the latest version."; - } else { - console.log("ArmCord is up to date."); - } - }); + if (window.armcord.version === "DEV") { + console.log("Running a development build of ArmCord. Skipping updater."); + } else { + fetch("https://armcord.xyz/latest.json") + .then((response) => response.json()) + .then((data) => { + if (data.version !== window.armcord.version) { + var elem = document.createElement("img"); + elem.classList.add("logo"); + elem.src = "https://armcord.smartfridge.space/update.webp"; + document.body.prepend(elem); + document.getElementById("splashscreen-armcord").remove(); + text.innerHTML = + "A new version of ArmCord is available. Please update to the latest version."; + } else { + console.log("ArmCord is up to date."); + } + }); + } setTimeout(() => { window.armcordinternal.splashEnd(); switch (window.armcord.channel) {