diff --git a/electron-builder.json b/electron-builder.json index f17cf50f..31ac9011 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -1,7 +1,7 @@ { "publish": [{ "provider": "generic", - "url": "http://desktopupdate.mattermost.com/" + "url": "https://releases.mattermost.com/desktop/" }], "appId": "com.mattermost.desktop", "artifactName": "${name}-${version}-${os}-${arch}.${ext}", diff --git a/src/main.js b/src/main.js index 231593c8..97f16d34 100644 --- a/src/main.js +++ b/src/main.js @@ -662,7 +662,7 @@ app.on('ready', () => { } else { setTimeout(() => { ipcMain.emit('check-for-updates'); - }, autoUpdater.INTERVAL_48_HOURS_IN_MS); + }, autoUpdater.UPDATER_INTERVAL_IN_MS); } }); } diff --git a/src/main/autoUpdater.js b/src/main/autoUpdater.js index def93f25..3bd9dba5 100644 --- a/src/main/autoUpdater.js +++ b/src/main/autoUpdater.js @@ -11,7 +11,8 @@ import logger from 'electron-log'; import {autoUpdater, CancellationToken} from 'electron-updater'; import semver from 'semver'; -const INTERVAL_48_HOURS_IN_MS = 5 * 60 * 1000; // 5 min. +// eslint-disable-next-line no-magic-numbers +const UPDATER_INTERVAL_IN_MS = 48 * 60 * 60 * 1000; // 48 hours autoUpdater.logger = logger; autoUpdater.logger.transports.file.level = 'info'; @@ -70,7 +71,7 @@ function isUpdateApplicable(now, skippedVersion, updateInfo) { const releaseTime = new Date(updateInfo.releaseDate).getTime(); // 48 hours after a new version is added to releases.mattermost.com, user receives a “New update is available” dialog - if (now.getTime() - releaseTime < INTERVAL_48_HOURS_IN_MS) { + if (now.getTime() - releaseTime < UPDATER_INTERVAL_IN_MS) { return false; } @@ -112,7 +113,7 @@ function initialize(appState, mainWindow, notifyOnly = false) { appState.updateCheckedDate = new Date(); setTimeout(() => { // eslint-disable-line max-nested-callbacks autoUpdater.checkForUpdates(); - }, INTERVAL_48_HOURS_IN_MS); + }, UPDATER_INTERVAL_IN_MS); updaterModal.close(); }).on('click-install', () => { updaterModal.webContents.send('start-download'); @@ -145,13 +146,13 @@ function initialize(appState, mainWindow, notifyOnly = false) { } setTimeout(() => { autoUpdater.checkForUpdates(); - }, INTERVAL_48_HOURS_IN_MS); + }, UPDATER_INTERVAL_IN_MS); }); } function shouldCheckForUpdatesOnStart(updateCheckedDate) { if (updateCheckedDate) { - if (Date.now() - updateCheckedDate.getTime() < INTERVAL_48_HOURS_IN_MS) { + if (Date.now() - updateCheckedDate.getTime() < UPDATER_INTERVAL_IN_MS) { return false; } } @@ -187,7 +188,7 @@ function loadConfig(file) { } export default { - INTERVAL_48_HOURS_IN_MS, + UPDATER_INTERVAL_IN_MS, checkForUpdates, shouldCheckForUpdatesOnStart, initialize,