diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2019-03-04 11:12:03 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2019-03-04 13:27:22 +0100 |
| commit | 2bce45b6752cc8f17135c0b382fb4f0dc9d3b3ee (patch) | |
| tree | 8dc4d53eeaf68e43c5db0634a051a7a266a17e69 | |
| parent | 2254454f65d24986beef6eaa5292c01856176e54 (diff) | |
| download | mullvadvpn-2bce45b6752cc8f17135c0b382fb4f0dc9d3b3ee.tar.xz mullvadvpn-2bce45b6752cc8f17135c0b382fb4f0dc9d3b3ee.zip | |
Update GUI to use new appVersionInfo layout
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 6 | ||||
| -rw-r--r-- | gui/src/main/index.ts | 10 | ||||
| -rw-r--r-- | gui/src/renderer/redux/version/reducers.ts | 7 | ||||
| -rw-r--r-- | gui/src/shared/daemon-rpc-types.ts | 6 |
4 files changed, 10 insertions, 19 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index a52c3b431a..5351b81946 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -231,10 +231,8 @@ const tunnelStateTransitionSchema = oneOf( const appVersionInfoSchema = partialObject({ current_is_supported: boolean, - latest: partialObject({ - latest_stable: string, - latest: string, - }), + latest_stable: string, + latest: string, }); export class ConnectionObserver { diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index fb5f6efb54..6bf46b2bdd 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -103,10 +103,8 @@ class ApplicationMain { private upgradeVersion: IAppUpgradeInfo = { currentIsSupported: true, - latest: { - latestStable: '', - latest: '', - }, + latestStable: '', + latest: '', nextUpgrade: undefined, upToDate: true, }; @@ -616,8 +614,8 @@ class ApplicationMain { } const currentVersionInfo = this.currentVersion; - const latestVersion = latestVersionInfo.latest.latest; - const latestStableVersion = latestVersionInfo.latest.latestStable; + 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 diff --git a/gui/src/renderer/redux/version/reducers.ts b/gui/src/renderer/redux/version/reducers.ts index 775b605ded..034e3aab59 100644 --- a/gui/src/renderer/redux/version/reducers.ts +++ b/gui/src/renderer/redux/version/reducers.ts @@ -25,14 +25,11 @@ export default function( action: ReduxAction, ): IVersionReduxState { switch (action.type) { - case 'UPDATE_LATEST': { - const { latest, ...other } = action.latestInfo; + case 'UPDATE_LATEST': return { ...state, - ...other, - ...latest, + ...action.latestInfo, }; - } case 'UPDATE_VERSION': return { diff --git a/gui/src/shared/daemon-rpc-types.ts b/gui/src/shared/daemon-rpc-types.ts index c4e2f6e53f..2158926300 100644 --- a/gui/src/shared/daemon-rpc-types.ts +++ b/gui/src/shared/daemon-rpc-types.ts @@ -195,10 +195,8 @@ export interface IShadowsocksProxySettings { export interface IAppVersionInfo { currentIsSupported: boolean; - latest: { - latestStable: string; - latest: string; - }; + latestStable: string; + latest: string; } export interface ISettings { |
