Skip to content

Commit

Permalink
fix: auto-update was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
sneljo1 committed Feb 22, 2020
1 parent d612b5c commit db82206
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/main/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ export class Auryo {
});

this.mainWindow.on('ready-to-show', () => {
this.logger.debug('ready-to-show', !!this.mainWindow);
if (this.mainWindow) {
this.mainWindow.show();
}
Expand Down
7 changes: 7 additions & 0 deletions src/main/features/core/appUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { gt as isVersionGreaterThan, valid as parseVersion } from 'semver';
import { CONFIG } from '../../../config';
import { Logger, LoggerInstance } from '../../utils/logger';
import { Feature } from '../feature';
import { Auryo } from '@main/app';

export default class AppUpdater extends Feature {
public readonly featureName = 'AppUpdater';
Expand All @@ -18,6 +19,11 @@ export default class AppUpdater extends Feature {
private hasUpdate = false;
private readonly currentVersion: string | null = parseVersion(app.getVersion());

constructor(auryo: Auryo) {
super(auryo, 'ready-to-show');
autoUpdater.logger = this.logger;
}

public shouldRun() {
return (
!process.env.TOKEN &&
Expand Down Expand Up @@ -76,6 +82,7 @@ export default class AppUpdater extends Feature {
autoUpdater.checkForUpdates();
}, 3600000);
});
autoUpdater.checkForUpdates();
}
};

Expand Down

0 comments on commit db82206

Please sign in to comment.