summaryrefslogtreecommitdiffhomepage
path: root/gui/src/main
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2019-09-03 14:34:14 +0200
committerLinus Färnstrand <linus@mullvad.net>2019-09-09 12:31:33 +0200
commit9ef235edd8d7c2f8e7a2a5bbd42d8467742172eb (patch)
treed903097cdb104b659b872f77aa961aa4df0281af /gui/src/main
parent82497c9bc8cf8f40ab179330a7f9d19ec7dfa057 (diff)
downloadmullvadvpn-9ef235edd8d7c2f8e7a2a5bbd42d8467742172eb.tar.xz
mullvadvpn-9ef235edd8d7c2f8e7a2a5bbd42d8467742172eb.zip
Add current_is_outdated support to Electron frontend
Diffstat (limited to 'gui/src/main')
-rw-r--r--gui/src/main/daemon-rpc.ts1
-rw-r--r--gui/src/main/index.ts17
2 files changed, 2 insertions, 16 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts
index 2d4141304e..25f0d32748 100644
--- a/gui/src/main/daemon-rpc.ts
+++ b/gui/src/main/daemon-rpc.ts
@@ -284,6 +284,7 @@ const tunnelStateSchema = oneOf(
const appVersionInfoSchema = partialObject({
current_is_supported: boolean,
+ current_is_outdated: boolean,
latest_stable: string,
latest: string,
});
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index a0694e814c..4f0454d5e2 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -64,7 +64,6 @@ export interface ICurrentAppVersionInfo {
export interface IAppUpgradeInfo extends IAppVersionInfo {
nextUpgrade?: string;
- upToDate: boolean;
}
type AccountVerification = { status: 'verified' } | { status: 'deferred'; error: Error };
@@ -134,10 +133,10 @@ class ApplicationMain {
private upgradeVersion: IAppUpgradeInfo = {
currentIsSupported: true,
+ currentIsOutdated: false,
latestStable: '',
latest: '',
nextUpgrade: undefined,
- upToDate: true,
};
private latestVersionInterval?: NodeJS.Timeout;
@@ -722,23 +721,10 @@ class ApplicationMain {
}
}
- function checkIfLatest(current: string, latest: string, latestStable: string): boolean {
- // perhaps -beta?
- if (isBeta(current)) {
- return current === latest;
- } else {
- // must be stable
- return current === latestStable;
- }
- }
-
const currentVersionInfo = this.currentVersion;
const latestVersion = latestVersionInfo.latest;
const latestStableVersion = latestVersionInfo.latestStable;
- // the reason why we rely on daemon version here is because daemon obtains the version info
- // based on its built-in version information
- const isUpToDate = checkIfLatest(currentVersionInfo.daemon, latestVersion, latestStableVersion);
const upgradeVersion = nextUpgrade(
currentVersionInfo.daemon,
latestVersion,
@@ -748,7 +734,6 @@ class ApplicationMain {
const upgradeInfo = {
...latestVersionInfo,
nextUpgrade: upgradeVersion,
- upToDate: isUpToDate,
};
this.upgradeVersion = upgradeInfo;