feat: Check for desktop update on launch

This commit is contained in:
Susmitha Girumala committed 2021-04-12 16:26:46 -04:00
1 parent efcdd0701e
commit b0a93e2e2d
2 files changed
+6 -3

No files matched your search

+2 -3
View File
@@ -88,10 +88,9 @@ const downloadAndInstallUpdate = async (version) => {
* Configure inbuilt app updater to use a custom config file
* to download and install next available app version.
* TODO: download progress in dialog
* TODO: Read current version from app config
**/
module.exports = {
run: async () => {
run: async ({ suppressNoUpdatePrompt }) => {
let latestVersion;
if (debug) {
latestVersion = process.env.APP_UPDATER_LATEST_VERSION_TAG;
@@ -105,7 +104,7 @@ module.exports = {
}
// Update not available - do nothing
if (semver.lte(latestVersion, currentVersion)) {
if (!suppressNoUpdatePrompt && semver.lte(latestVersion, currentVersion)) {
const dialogOpts = {
type: 'info',
icon: null,
+4
View File
@@ -19,6 +19,7 @@ const origin = require('./origin.js');
const { generateCSPHeader } = require('./content-security-policy.js');
const menu = require('./menu.js');
const appUpdater = require('./app-updater.js');
const isDev = require('electron-is-dev');
// Register the custom file protocol
@@ -138,6 +139,9 @@ app.on('ready', async () => {
// Load the ember application
mainWindow.loadURL(emberAppURL);
// Check for updates on launch
appUpdater.run({ suppressNoUpdatePrompt: true });
// If a loading operation goes wrong, we'll send Electron back to
// Ember App entry point
mainWindow.webContents.on('did-fail-load', () => {