diff options
| author | Andrej Mihajlov <and@mullvad.net> | 2019-09-10 14:35:00 +0200 |
|---|---|---|
| committer | Andrej Mihajlov <and@mullvad.net> | 2019-09-12 12:50:51 +0200 |
| commit | 57f5d8f246fa688a36e3138cbbcd51dd95fdf7ea (patch) | |
| tree | fc85b595edbdda91e5f7e894d7ed536d0ac69ba8 /gui/src/renderer/redux/userinterface | |
| parent | ef20b724201e5c374e6080298974bc8e97818cf2 (diff) | |
| download | mullvadvpn-57f5d8f246fa688a36e3138cbbcd51dd95fdf7ea.tar.xz mullvadvpn-57f5d8f246fa688a36e3138cbbcd51dd95fdf7ea.zip | |
Add bridge selector
Diffstat (limited to 'gui/src/renderer/redux/userinterface')
| -rw-r--r-- | gui/src/renderer/redux/userinterface/actions.ts | 19 | ||||
| -rw-r--r-- | gui/src/renderer/redux/userinterface/reducers.ts | 10 |
2 files changed, 27 insertions, 2 deletions
diff --git a/gui/src/renderer/redux/userinterface/actions.ts b/gui/src/renderer/redux/userinterface/actions.ts index 0af66cd365..f9e2fff444 100644 --- a/gui/src/renderer/redux/userinterface/actions.ts +++ b/gui/src/renderer/redux/userinterface/actions.ts @@ -1,3 +1,5 @@ +import { LocationScope } from './reducers'; + export interface IUpdateWindowArrowPositionAction { type: 'UPDATE_WINDOW_ARROW_POSITION'; arrowPosition: number; @@ -7,9 +9,15 @@ export interface IUpdateConnectionInfoOpenAction { type: 'TOGGLE_CONNECTION_PANEL'; } +export interface ISetLocationScopeAction { + type: 'SET_LOCATION_SCOPE'; + scope: LocationScope; +} + export type UserInterfaceAction = | IUpdateWindowArrowPositionAction - | IUpdateConnectionInfoOpenAction; + | IUpdateConnectionInfoOpenAction + | ISetLocationScopeAction; function updateWindowArrowPosition(arrowPosition: number): IUpdateWindowArrowPositionAction { return { @@ -24,4 +32,11 @@ function toggleConnectionPanel(): IUpdateConnectionInfoOpenAction { }; } -export default { updateWindowArrowPosition, toggleConnectionPanel }; +function setLocationScope(scope: LocationScope): ISetLocationScopeAction { + return { + type: 'SET_LOCATION_SCOPE', + scope, + }; +} + +export default { updateWindowArrowPosition, toggleConnectionPanel, setLocationScope }; diff --git a/gui/src/renderer/redux/userinterface/reducers.ts b/gui/src/renderer/redux/userinterface/reducers.ts index c6e7aafde8..729d5194b6 100644 --- a/gui/src/renderer/redux/userinterface/reducers.ts +++ b/gui/src/renderer/redux/userinterface/reducers.ts @@ -1,12 +1,19 @@ import { ReduxAction } from '../store'; +export enum LocationScope { + bridge = 0, + relay, +} + export interface IUserInterfaceReduxState { arrowPosition?: number; connectionPanelVisible: boolean; + locationScope: LocationScope; } const initialState: IUserInterfaceReduxState = { connectionPanelVisible: false, + locationScope: LocationScope.relay, }; export default function( @@ -20,6 +27,9 @@ export default function( case 'TOGGLE_CONNECTION_PANEL': return { ...state, connectionPanelVisible: !state.connectionPanelVisible }; + case 'SET_LOCATION_SCOPE': + return { ...state, locationScope: action.scope }; + default: return state; } |
