diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-07-01 08:34:09 -0300 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2019-07-01 08:34:09 -0300 |
| commit | 6d6d74df30a031ce8a8db2602485917ac6ca66da (patch) | |
| tree | 145b7c8083be620ff8c7274b613e14caf58aeb14 /gui/src/renderer | |
| parent | 8f6c45227f4d9af8bf2dd9a39a7adb86d4fa8be6 (diff) | |
| parent | 2185ba222098cca1f802c6d3e3acb9a4a3f49f2d (diff) | |
| download | mullvadvpn-6d6d74df30a031ce8a8db2602485917ac6ca66da.tar.xz mullvadvpn-6d6d74df30a031ce8a8db2602485917ac6ca66da.zip | |
Merge branch 'broadcast-relay-location'
Diffstat (limited to 'gui/src/renderer')
| -rw-r--r-- | gui/src/renderer/app.tsx | 15 | ||||
| -rw-r--r-- | gui/src/renderer/components/NotificationArea.tsx | 4 | ||||
| -rw-r--r-- | gui/src/renderer/components/TunnelControl.tsx | 4 | ||||
| -rw-r--r-- | gui/src/renderer/containers/ConnectionPanelContainer.tsx | 4 | ||||
| -rw-r--r-- | gui/src/renderer/redux/connection/actions.ts | 14 | ||||
| -rw-r--r-- | gui/src/renderer/redux/connection/reducers.ts | 8 |
6 files changed, 23 insertions, 26 deletions
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx index ec7ba833e8..3d5a6eb0e5 100644 --- a/gui/src/renderer/app.tsx +++ b/gui/src/renderer/app.tsx @@ -38,7 +38,7 @@ import { ISettings, RelaySettings, RelaySettingsUpdate, - TunnelStateTransition, + TunnelState, } from '../shared/daemon-rpc-types'; type AccountVerification = { status: 'verified' } | { status: 'deferred'; error: Error }; @@ -70,7 +70,7 @@ export default class AppRenderer { ); private locale: string; - private tunnelState: TunnelStateTransition; + private tunnelState: TunnelState; private settings: ISettings; private guiSettings: IGuiSettingsState; private accountExpiry?: AccountExpiry; @@ -109,7 +109,7 @@ export default class AppRenderer { this.setAccountHistory(newAccountHistory); }); - IpcRendererEventChannel.tunnel.listen((newState: TunnelStateTransition) => { + IpcRendererEventChannel.tunnel.listen((newState: TunnelState) => { this.setTunnelState(newState); this.updateBlockedState(newState, this.settings.blockWhenDisconnected); @@ -461,7 +461,7 @@ export default class AppRenderer { this.reduxActions.account.updateAccountHistory(accountHistory); } - private setTunnelState(tunnelState: TunnelStateTransition) { + private setTunnelState(tunnelState: TunnelState) { const actions = this.reduxActions; log.debug(`Tunnel state: ${tunnelState.state}`); @@ -513,7 +513,7 @@ export default class AppRenderer { } } - private updateBlockedState(tunnelState: TunnelStateTransition, blockWhenDisconnected: boolean) { + private updateBlockedState(tunnelState: TunnelState, blockWhenDisconnected: boolean) { const actions = this.reduxActions.connection; switch (tunnelState.state) { case 'connecting': @@ -604,10 +604,7 @@ export default class AppRenderer { this.reduxActions.account.updateAccountExpiry(expiry); } - private detectStaleAccountExpiry( - tunnelState: TunnelStateTransition, - accountExpiry: AccountExpiry, - ) { + private detectStaleAccountExpiry(tunnelState: TunnelState, accountExpiry: AccountExpiry) { // It's likely that the account expiry is stale if the daemon managed to establish the tunnel. if (tunnelState.state === 'connected' && accountExpiry.hasExpired()) { log.info('Detected the stale account expiry.'); diff --git a/gui/src/renderer/components/NotificationArea.tsx b/gui/src/renderer/components/NotificationArea.tsx index 062bb45da7..e120e25895 100644 --- a/gui/src/renderer/components/NotificationArea.tsx +++ b/gui/src/renderer/components/NotificationArea.tsx @@ -14,7 +14,7 @@ import { NotificationTitle, } from './NotificationBanner'; -import { BlockReason, TunnelStateTransition } from '../../shared/daemon-rpc-types'; +import { BlockReason, TunnelState } from '../../shared/daemon-rpc-types'; import AccountExpiry from '../lib/account-expiry'; import { parseAuthFailure } from '../lib/auth-failure'; import { IVersionReduxState } from '../redux/version/reducers'; @@ -22,7 +22,7 @@ import { IVersionReduxState } from '../redux/version/reducers'; interface IProps { style?: Types.ViewStyleRuleSet; accountExpiry?: AccountExpiry; - tunnelState: TunnelStateTransition; + tunnelState: TunnelState; version: IVersionReduxState; openExternalLink: (url: string) => void; blockWhenDisconnected: boolean; diff --git a/gui/src/renderer/components/TunnelControl.tsx b/gui/src/renderer/components/TunnelControl.tsx index ffb7ac2479..a03332194e 100644 --- a/gui/src/renderer/components/TunnelControl.tsx +++ b/gui/src/renderer/components/TunnelControl.tsx @@ -1,14 +1,14 @@ import * as React from 'react'; import { Component, Styles, Text, Types, View } from 'reactxp'; import { colors } from '../../config.json'; -import { TunnelStateTransition } from '../../shared/daemon-rpc-types'; +import { TunnelState } from '../../shared/daemon-rpc-types'; import { cities, countries, messages, relayLocations } from '../../shared/gettext'; import ConnectionPanelContainer from '../containers/ConnectionPanelContainer'; import * as AppButton from './AppButton'; import SecuredLabel, { SecuredDisplayStyle } from './SecuredLabel'; interface ITunnelControlProps { - tunnelState: TunnelStateTransition; + tunnelState: TunnelState; selectedRelayName: string; city?: string; country?: string; diff --git a/gui/src/renderer/containers/ConnectionPanelContainer.tsx b/gui/src/renderer/containers/ConnectionPanelContainer.tsx index 77b164c65b..44d3330c78 100644 --- a/gui/src/renderer/containers/ConnectionPanelContainer.tsx +++ b/gui/src/renderer/containers/ConnectionPanelContainer.tsx @@ -43,12 +43,12 @@ const mapStateToProps = (state: IReduxState) => { const inAddress: IInAddress | undefined = (status.state === 'connecting' || status.state === 'connected') && status.details - ? tunnelEndpointToRelayInAddress(status.details) + ? tunnelEndpointToRelayInAddress(status.details.endpoint) : undefined; const bridgeInfo: IBridgeData | undefined = (status.state === 'connecting' || status.state === 'connected') && status.details - ? tunnelEndpointToBridgeData(status.details) + ? tunnelEndpointToBridgeData(status.details.endpoint) : undefined; return { diff --git a/gui/src/renderer/redux/connection/actions.ts b/gui/src/renderer/redux/connection/actions.ts index b84e85f8e6..8f5b2e62bb 100644 --- a/gui/src/renderer/redux/connection/actions.ts +++ b/gui/src/renderer/redux/connection/actions.ts @@ -2,17 +2,17 @@ import { AfterDisconnect, BlockReason, ILocation, - ITunnelEndpoint, + ITunnelStateRelayInfo, } from '../../../shared/daemon-rpc-types'; interface IConnectingAction { type: 'CONNECTING'; - tunnelEndpoint?: ITunnelEndpoint; + details?: ITunnelStateRelayInfo; } interface IConnectedAction { type: 'CONNECTED'; - tunnelEndpoint: ITunnelEndpoint; + details: ITunnelStateRelayInfo; } interface IDisconnectedAction { @@ -48,17 +48,17 @@ export type ConnectionAction = | IBlockedAction | IUpdateBlockStateAction; -function connecting(tunnelEndpoint?: ITunnelEndpoint): IConnectingAction { +function connecting(details?: ITunnelStateRelayInfo): IConnectingAction { return { type: 'CONNECTING', - tunnelEndpoint, + details, }; } -function connected(tunnelEndpoint: ITunnelEndpoint): IConnectedAction { +function connected(details: ITunnelStateRelayInfo): IConnectedAction { return { type: 'CONNECTED', - tunnelEndpoint, + details, }; } diff --git a/gui/src/renderer/redux/connection/reducers.ts b/gui/src/renderer/redux/connection/reducers.ts index 2719f3d3db..4772df8fc5 100644 --- a/gui/src/renderer/redux/connection/reducers.ts +++ b/gui/src/renderer/redux/connection/reducers.ts @@ -1,8 +1,8 @@ -import { Ip, TunnelStateTransition } from '../../../shared/daemon-rpc-types'; +import { Ip, TunnelState } from '../../../shared/daemon-rpc-types'; import { ReduxAction } from '../store'; export interface IConnectionReduxState { - status: TunnelStateTransition; + status: TunnelState; isBlocked: boolean; ipv4?: Ip; ipv6?: Ip; @@ -41,13 +41,13 @@ export default function( case 'CONNECTING': return { ...state, - status: { state: 'connecting', details: action.tunnelEndpoint }, + status: { state: 'connecting', details: action.details }, }; case 'CONNECTED': return { ...state, - status: { state: 'connected', details: action.tunnelEndpoint }, + status: { state: 'connected', details: action.details }, }; case 'DISCONNECTED': |
