diff --git a/server/check-version.js b/server/check-version.js index a3465ddf0..f3b15e848 100644 --- a/server/check-version.js +++ b/server/check-version.js @@ -1,5 +1,6 @@ -const { setSetting } = require("./util-server"); +const { setSetting, setting } = require("./util-server"); const axios = require("axios"); +const compareVersions = require("compare-versions"); exports.version = require("../package.json").version; exports.latestVersion = null; @@ -16,6 +17,19 @@ exports.startInterval = () => { res.data.slow = "1000.0.0"; } + if (!await setting("checkUpdate")) { + return; + } + + let checkBeta = await setting("checkBeta"); + + if (checkBeta && res.data.beta) { + if (compareVersions.compare(res.data.beta, res.data.beta, ">")) { + exports.latestVersion = res.data.beta; + return; + } + } + if (res.data.slow) { exports.latestVersion = res.data.slow; } diff --git a/src/components/settings/About.vue b/src/components/settings/About.vue index baa72f39a..ad134094e 100644 --- a/src/components/settings/About.vue +++ b/src/components/settings/About.vue @@ -4,14 +4,39 @@