Skip to content

Commit

Permalink
don't try to update when system is sleeping
Browse files Browse the repository at this point in the history
  • Loading branch information
MayGo committed Aug 25, 2021
1 parent bda773e commit ef14010
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion electron/app/app-updater.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { stateManager } from './state-manager';
import { app, dialog } from 'electron';
import { autoUpdater, UpdateCheckResult, UpdateInfo } from 'electron-updater';
import config from './config';
Expand Down Expand Up @@ -68,7 +69,7 @@ export default class AppUpdater {
isAutoUpdateEnabled =
typeof isAutoUpdateEnabled !== 'undefined' ? isAutoUpdateEnabled : true;

if (isAutoUpdateEnabled) {
if (isAutoUpdateEnabled && !stateManager.isSystemSleeping()) {
logger.debug('Checking for updates.');
autoUpdater.checkForUpdates();
} else {
Expand Down

0 comments on commit ef14010

Please sign in to comment.