Skip to content

Commit

Permalink
fix: Auto update
Browse files Browse the repository at this point in the history
  • Loading branch information
cyaiox committed Sep 13, 2024
1 parent 668b517 commit 428e8c0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/main/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import * as Sentry from '@sentry/electron/main';
import { initProtocol } from './modules/protocol';
import { restoreOrCreateWindow } from './mainWindow';
import './security-restrictions';
import { getOSName, PLATFORM } from './helpers';

// Initialize Sentry
Sentry.init({
Expand Down Expand Up @@ -65,6 +64,7 @@ app
*/
function updateAppAndQuit() {
if (import.meta.env.PROD) {
updater.autoUpdater.autoInstallOnAppQuit = true;
updater.autoUpdater.autoRunAppAfterInstall = false;
updater.autoUpdater.on('checking-for-update', () => {
log.info('[Main Window][AutoUpdater] Checking for updates');
Expand All @@ -81,11 +81,7 @@ function updateAppAndQuit() {
});
updater.autoUpdater.on('update-downloaded', _info => {
log.info('[Main Window][AutoUpdater] Update downloaded');
if (getOSName() === PLATFORM.WINDOWS) {
updater.autoUpdater.quitAndInstall(true, false);
} else {
app.quit();
}
app.quit();
});
updater.autoUpdater.on('error', err => {
log.error('[Main Window][AutoUpdater] Error in auto-updater', err);
Expand Down

0 comments on commit 428e8c0

Please sign in to comment.