From d825a1a45a28c585dae76330aa81ecbf2c54f55f Mon Sep 17 00:00:00 2001 From: zadam Date: Wed, 20 Jul 2022 00:11:12 +0200 Subject: [PATCH] remove checkForUpdates from login screen --- src/public/app/widgets/buttons/global_menu.js | 14 +++++++------- src/routes/login.js | 2 -- src/views/set_password.ejs | 4 ---- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/public/app/widgets/buttons/global_menu.js b/src/public/app/widgets/buttons/global_menu.js index 658b24d00..efc0c0396 100644 --- a/src/public/app/widgets/buttons/global_menu.js +++ b/src/public/app/widgets/buttons/global_menu.js @@ -157,14 +157,14 @@ export default class GlobalMenuWidget extends BasicWidget { } async updateVersionStatus() { - if (options.get("checkForUpdates") == 'true') { - const latestVersion = await this.fetchLatestVersion(); - - this.updateAvailableWidget.updateVersionStatus(latestVersion); - - this.$updateToLatestVersionButton.toggle(latestVersion > glob.triliumVersion); - this.$updateToLatestVersionButton.find(".version-text").text(`Version ${latestVersion} is available, click to download.`); + if (options.get("checkForUpdates") !== 'true') { + return; } + + const latestVersion = await this.fetchLatestVersion(); + this.updateAvailableWidget.updateVersionStatus(latestVersion); + this.$updateToLatestVersionButton.toggle(latestVersion > glob.triliumVersion); + this.$updateToLatestVersionButton.find(".version-text").text(`Version ${latestVersion} is available, click to download.`); } async fetchLatestVersion() { diff --git a/src/routes/login.js b/src/routes/login.js index bd29e0765..3431f3431 100644 --- a/src/routes/login.js +++ b/src/routes/login.js @@ -5,7 +5,6 @@ const optionService = require('../services/options'); const myScryptService = require('../services/my_scrypt'); const log = require('../services/log'); const passwordService = require("../services/password"); -const options = require('../services/options'); function loginPage(req, res) { res.render('login', { failedAuth: false }); @@ -37,7 +36,6 @@ function setPassword(req, res) { return; } - options.setOption("checkForUpdates", req.body['check-for-updates'] == 'on'); passwordService.setPassword(password1); res.redirect('login'); diff --git a/src/views/set_password.ejs b/src/views/set_password.ejs index 0768f4825..65a967de7 100644 --- a/src/views/set_password.ejs +++ b/src/views/set_password.ejs @@ -33,10 +33,6 @@ -
- - -