diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2019-10-07 11:51:11 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2019-10-07 16:24:41 +0200 |
| commit | dba796eeee5117a751dddebdc16cedc32df4b310 (patch) | |
| tree | 41e1cc92a62b0c130c2026fe55e6ff139d4768c1 | |
| parent | 9df6790f52c74d433e50d2bd8c4ff9615cafc16c (diff) | |
| download | mullvadvpn-dba796eeee5117a751dddebdc16cedc32df4b310.tar.xz mullvadvpn-dba796eeee5117a751dddebdc16cedc32df4b310.zip | |
Update GUI when new version info is received
| -rw-r--r-- | gui/src/main/index.ts | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index e7822e6cd3..0672effcca 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -48,8 +48,6 @@ import ReconnectionBackoff from './reconnection-backoff'; import TrayIconController, { TrayIconType } from './tray-icon-controller'; import WindowController from './window-controller'; -const VERSION_UPDATE_INTERVAL = 24 * 60 * 60 * 1000; - const DAEMON_RPC_PATH = process.platform === 'win32' ? '//./pipe/Mullvad VPN' : '/var/run/mullvad-vpn'; @@ -141,7 +139,6 @@ class ApplicationMain { latest: '', nextUpgrade: undefined, }; - private latestVersionInterval?: NodeJS.Timeout; // The UI locale which is set once from onReady handler private locale = 'en'; @@ -446,9 +443,6 @@ class ApplicationMain { // fetch the latest version info in background this.fetchLatestVersion(); - // start periodic updates - this.startLatestVersionPeriodicUpdates(); - // notify user about inconsistent version if ( process.env.NODE_ENV !== 'development' && @@ -478,9 +472,6 @@ class ApplicationMain { if (wasConnected) { this.connectedToDaemon = false; - // stop periodic updates - this.stopLatestVersionPeriodicUpdates(); - // update the tray icon to indicate that the computer is not secure anymore this.updateTrayIcon({ state: 'disconnected' }, false); @@ -541,7 +532,7 @@ class ApplicationMain { } else if ('wireguardKey' in daemonEvent) { this.handleWireguardKeygenEvent(daemonEvent.wireguardKey); } else if ('appVersionInfo' in daemonEvent) { - this.setAppVersionInfo(daemonEvent.appVersionInfo); + this.setLatestVersion(daemonEvent.appVersionInfo); } }, (error: Error) => { @@ -588,10 +579,6 @@ class ApplicationMain { } } - private setAppVersionInfo(appVersionInfo: IAppVersionInfo) { - log.error(`Does not handle new AppVersionInfo yet: ${appVersionInfo}`); - } - private setTunnelState(newState: TunnelState) { this.tunnelState = newState; this.updateTrayIcon(newState, this.settings.blockWhenDisconnected); @@ -801,21 +788,6 @@ class ApplicationMain { } } - private startLatestVersionPeriodicUpdates() { - const handler = () => { - this.fetchLatestVersion(); - }; - this.latestVersionInterval = global.setInterval(handler, VERSION_UPDATE_INTERVAL); - } - - private stopLatestVersionPeriodicUpdates() { - if (this.latestVersionInterval) { - clearInterval(this.latestVersionInterval); - - this.latestVersionInterval = undefined; - } - } - private shouldSuppressNotifications(isCriticalNotification: boolean): boolean { const isVisible = this.windowController ? this.windowController.isVisible() : false; |
