summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/redux/settings
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2023-10-04 11:35:59 +0200
committerOskar Nyberg <oskar@mullvad.net>2023-10-09 10:16:53 +0200
commit469c501f736e98ea6a20f1e76b40550d6ad995cd (patch)
tree88c0fbab003216eff6bcaf2fb87c02d634025558 /gui/src/renderer/redux/settings
parent4e26e4c36345afbca25a1a1e760927cd74d2c1a5 (diff)
downloadmullvadvpn-469c501f736e98ea6a20f1e76b40550d6ad995cd.tar.xz
mullvadvpn-469c501f736e98ea6a20f1e76b40550d6ad995cd.zip
Add custom lists to settings, ipc and rpc calls
Diffstat (limited to 'gui/src/renderer/redux/settings')
-rw-r--r--gui/src/renderer/redux/settings/actions.ts25
-rw-r--r--gui/src/renderer/redux/settings/reducers.ts13
2 files changed, 32 insertions, 6 deletions
diff --git a/gui/src/renderer/redux/settings/actions.ts b/gui/src/renderer/redux/settings/actions.ts
index dad71de024..585aad5732 100644
--- a/gui/src/renderer/redux/settings/actions.ts
+++ b/gui/src/renderer/redux/settings/actions.ts
@@ -1,12 +1,13 @@
import { IWindowsApplication } from '../../../shared/application-types';
import {
BridgeState,
+ CustomLists,
IDnsOptions,
IWireguardEndpointData,
ObfuscationSettings,
} from '../../../shared/daemon-rpc-types';
import { IGuiSettingsState } from '../../../shared/gui-settings-state';
-import { BridgeSettingsRedux, IRelayLocationRedux, RelaySettingsRedux } from './reducers';
+import { BridgeSettingsRedux, IRelayLocationCountryRedux, RelaySettingsRedux } from './reducers';
export interface IUpdateGuiSettingsAction {
type: 'UPDATE_GUI_SETTINGS';
@@ -20,7 +21,7 @@ export interface IUpdateRelayAction {
export interface IUpdateRelayLocationsAction {
type: 'UPDATE_RELAY_LOCATIONS';
- relayLocations: IRelayLocationRedux[];
+ relayLocations: IRelayLocationCountryRedux[];
}
export interface IUpdateWireguardEndpointData {
@@ -98,6 +99,11 @@ export interface ISetObfuscationSettings {
obfuscationSettings: ObfuscationSettings;
}
+export interface ISetCustomLists {
+ type: 'SET_CUSTOM_LISTS';
+ customLists: CustomLists;
+}
+
export type SettingsAction =
| IUpdateGuiSettingsAction
| IUpdateRelayAction
@@ -116,7 +122,8 @@ export type SettingsAction =
| IUpdateDnsOptionsAction
| IUpdateSplitTunnelingStateAction
| ISetSplitTunnelingApplicationsAction
- | ISetObfuscationSettings;
+ | ISetObfuscationSettings
+ | ISetCustomLists;
function updateGuiSettings(guiSettings: IGuiSettingsState): IUpdateGuiSettingsAction {
return {
@@ -132,7 +139,9 @@ function updateRelay(relay: RelaySettingsRedux): IUpdateRelayAction {
};
}
-function updateRelayLocations(relayLocations: IRelayLocationRedux[]): IUpdateRelayLocationsAction {
+function updateRelayLocations(
+ relayLocations: IRelayLocationCountryRedux[],
+): IUpdateRelayLocationsAction {
return {
type: 'UPDATE_RELAY_LOCATIONS',
relayLocations,
@@ -254,6 +263,13 @@ function updateObfuscationSettings(
};
}
+function updateCustomLists(customLists: CustomLists): ISetCustomLists {
+ return {
+ type: 'SET_CUSTOM_LISTS',
+ customLists,
+ };
+}
+
export default {
updateGuiSettings,
updateRelay,
@@ -273,4 +289,5 @@ export default {
updateSplitTunnelingState,
setSplitTunnelingApplications,
updateObfuscationSettings,
+ updateCustomLists,
};
diff --git a/gui/src/renderer/redux/settings/reducers.ts b/gui/src/renderer/redux/settings/reducers.ts
index 2030d70844..b400799095 100644
--- a/gui/src/renderer/redux/settings/reducers.ts
+++ b/gui/src/renderer/redux/settings/reducers.ts
@@ -1,6 +1,7 @@
import { IWindowsApplication } from '../../../shared/application-types';
import {
BridgeState,
+ CustomLists,
IDnsOptions,
IpVersion,
IWireguardEndpointData,
@@ -77,7 +78,7 @@ export interface IRelayLocationCityRedux {
relays: IRelayLocationRelayRedux[];
}
-export interface IRelayLocationRedux {
+export interface IRelayLocationCountryRedux {
name: string;
code: string;
cities: IRelayLocationCityRedux[];
@@ -87,7 +88,7 @@ export interface ISettingsReduxState {
autoStart: boolean;
guiSettings: IGuiSettingsState;
relaySettings: RelaySettingsRedux;
- relayLocations: IRelayLocationRedux[];
+ relayLocations: IRelayLocationCountryRedux[];
wireguardEndpointData: IWireguardEndpointData;
allowLan: boolean;
enableIpv6: boolean;
@@ -106,6 +107,7 @@ export interface ISettingsReduxState {
splitTunneling: boolean;
splitTunnelingApplications: IWindowsApplication[];
obfuscationSettings: ObfuscationSettings;
+ customLists: CustomLists;
}
const initialState: ISettingsReduxState = {
@@ -169,6 +171,7 @@ const initialState: ISettingsReduxState = {
port: 'any',
},
},
+ customLists: [],
};
export default function (
@@ -293,6 +296,12 @@ export default function (
obfuscationSettings: action.obfuscationSettings,
};
+ case 'SET_CUSTOM_LISTS':
+ return {
+ ...state,
+ customLists: action.customLists,
+ };
+
default:
return state;
}