diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-03-04 16:30:14 +0100 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-03-04 16:38:31 +0100 |
| commit | e73fc128cd34546aaf76bf1d41ac5dbdcf01bf01 (patch) | |
| tree | 7eca03c44e0deffd764c491a05e3bb4e06f15b92 /gui | |
| parent | c8b52f145dd47f4d011fdef77ab75a4c2898b46f (diff) | |
| download | mullvadvpn-e73fc128cd34546aaf76bf1d41ac5dbdcf01bf01.tar.xz mullvadvpn-e73fc128cd34546aaf76bf1d41ac5dbdcf01bf01.zip | |
Add missing `ip` field in `NEW_LOCATION` action
Diffstat (limited to 'gui')
| -rw-r--r-- | gui/src/renderer/redux/connection/actions.ts | 18 | ||||
| -rw-r--r-- | gui/src/renderer/redux/connection/reducers.ts | 3 |
2 files changed, 9 insertions, 12 deletions
diff --git a/gui/src/renderer/redux/connection/actions.ts b/gui/src/renderer/redux/connection/actions.ts index f24d080a57..ff34b20e11 100644 --- a/gui/src/renderer/redux/connection/actions.ts +++ b/gui/src/renderer/redux/connection/actions.ts @@ -1,4 +1,9 @@ -import { AfterDisconnect, BlockReason, ITunnelEndpoint } from '../../../shared/daemon-rpc-types'; +import { + AfterDisconnect, + BlockReason, + ILocation, + ITunnelEndpoint, +} from '../../../shared/daemon-rpc-types'; interface IConnectingAction { type: 'CONNECTING'; @@ -26,14 +31,7 @@ interface IBlockedAction { interface INewLocationAction { type: 'NEW_LOCATION'; - newLocation: { - country: string; - city?: string; - latitude: number; - longitude: number; - mullvadExitIp: boolean; - hostname?: string; - }; + newLocation: ILocation; } interface IOnlineAction { @@ -88,7 +86,7 @@ function blocked(reason: BlockReason): IBlockedAction { }; } -function newLocation(location: INewLocationAction['newLocation']): INewLocationAction { +function newLocation(location: ILocation): INewLocationAction { return { type: 'NEW_LOCATION', newLocation: location, diff --git a/gui/src/renderer/redux/connection/reducers.ts b/gui/src/renderer/redux/connection/reducers.ts index bd22a6f110..af92e0fd6f 100644 --- a/gui/src/renderer/redux/connection/reducers.ts +++ b/gui/src/renderer/redux/connection/reducers.ts @@ -31,8 +31,7 @@ export default function( ): IConnectionReduxState { switch (action.type) { case 'NEW_LOCATION': - const { hostname, latitude, longitude, city, country } = action.newLocation; - return { ...state, hostname, latitude, longitude, city, country }; + return { ...state, ...action.newLocation }; case 'CONNECTING': return { |
