diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2024-04-08 08:18:49 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2024-04-11 17:21:23 +0200 |
| commit | abd2912d013df44c6aea983205c4bc173f6f748b (patch) | |
| tree | 4f69d6b6d5be70941f05e3769644862329ab3092 /gui/src/renderer/redux/userinterface | |
| parent | d8ead1aa606fe9fec9cc0875dc86dd2829324971 (diff) | |
| download | mullvadvpn-abd2912d013df44c6aea983205c4bc173f6f748b.tar.xz mullvadvpn-abd2912d013df44c6aea983205c4bc173f6f748b.zip | |
Move location type state to redux
Diffstat (limited to 'gui/src/renderer/redux/userinterface')
| -rw-r--r-- | gui/src/renderer/redux/userinterface/actions.ts | 17 | ||||
| -rw-r--r-- | gui/src/renderer/redux/userinterface/reducers.ts | 9 |
2 files changed, 25 insertions, 1 deletions
diff --git a/gui/src/renderer/redux/userinterface/actions.ts b/gui/src/renderer/redux/userinterface/actions.ts index b4b5885370..cc43990980 100644 --- a/gui/src/renderer/redux/userinterface/actions.ts +++ b/gui/src/renderer/redux/userinterface/actions.ts @@ -1,5 +1,6 @@ import { MacOsScrollbarVisibility } from '../../../shared/ipc-schema'; import { IChangelog } from '../../../shared/ipc-types'; +import { LocationType } from '../../components/select-location/select-location-types'; export interface IUpdateLocaleAction { type: 'UPDATE_LOCALE'; @@ -50,6 +51,11 @@ export interface ISetIsPerformingPostUpgrade { isPerformingPostUpgrade: boolean; } +export interface ISetSelectLocationView { + type: 'SET_SELECT_LOCATION_VIEW'; + selectLocationView: LocationType; +} + export type UserInterfaceAction = | IUpdateLocaleAction | IUpdateWindowArrowPositionAction @@ -60,7 +66,8 @@ export type UserInterfaceAction = | ISetDaemonAllowed | ISetChangelog | ISetForceShowChanges - | ISetIsPerformingPostUpgrade; + | ISetIsPerformingPostUpgrade + | ISetSelectLocationView; function updateLocale(locale: string): IUpdateLocaleAction { return { @@ -133,6 +140,13 @@ function setIsPerformingPostUpgrade(isPerformingPostUpgrade: boolean): ISetIsPer }; } +function setSelectLocationView(selectLocationView: LocationType): ISetSelectLocationView { + return { + type: 'SET_SELECT_LOCATION_VIEW', + selectLocationView, + }; +} + export default { updateLocale, updateWindowArrowPosition, @@ -144,4 +158,5 @@ export default { setChangelog, setForceShowChanges, setIsPerformingPostUpgrade, + setSelectLocationView, }; diff --git a/gui/src/renderer/redux/userinterface/reducers.ts b/gui/src/renderer/redux/userinterface/reducers.ts index f9ecc6fdad..622b7814aa 100644 --- a/gui/src/renderer/redux/userinterface/reducers.ts +++ b/gui/src/renderer/redux/userinterface/reducers.ts @@ -1,5 +1,6 @@ import { MacOsScrollbarVisibility } from '../../../shared/ipc-schema'; import { IChangelog } from '../../../shared/ipc-types'; +import { LocationType } from '../../components/select-location/select-location-types'; import { ReduxAction } from '../store'; export interface IUserInterfaceReduxState { @@ -13,6 +14,7 @@ export interface IUserInterfaceReduxState { changelog: IChangelog; forceShowChanges: boolean; isPerformingPostUpgrade: boolean; + selectLocationView: LocationType; } const initialState: IUserInterfaceReduxState = { @@ -25,6 +27,7 @@ const initialState: IUserInterfaceReduxState = { changelog: [], forceShowChanges: false, isPerformingPostUpgrade: false, + selectLocationView: LocationType.exit, }; export default function ( @@ -71,6 +74,12 @@ export default function ( isPerformingPostUpgrade: action.isPerformingPostUpgrade, }; + case 'SET_SELECT_LOCATION_VIEW': + return { + ...state, + selectLocationView: action.selectLocationView, + }; + default: return state; } |
