From e7104737e7c877a1fda546cf271ce9a30baf2876 Mon Sep 17 00:00:00 2001 From: Louis Lam Date: Sun, 31 Oct 2021 00:36:46 +0800 Subject: [PATCH] prevent to show "New Update" when the Docker image is not ready yet --- server/check-version.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/server/check-version.js b/server/check-version.js index 2ab5fe514..a3465ddf0 100644 --- a/server/check-version.js +++ b/server/check-version.js @@ -9,18 +9,17 @@ let interval; exports.startInterval = () => { let check = async () => { try { - const res = await axios.get("https://raw.githubusercontent.com/louislam/uptime-kuma/master/package.json"); - - if (typeof res.data === "string") { - res.data = JSON.parse(res.data); - } + const res = await axios.get("https://uptime.kuma.pet/version"); // For debug if (process.env.TEST_CHECK_VERSION === "1") { - res.data.version = "1000.0.0"; + res.data.slow = "1000.0.0"; + } + + if (res.data.slow) { + exports.latestVersion = res.data.slow; } - exports.latestVersion = res.data.version; } catch (_) { } };