summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/renderer')
-rw-r--r--gui/src/renderer/redux/connection/actions.ts18
-rw-r--r--gui/src/renderer/redux/connection/reducers.ts3
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 {