summaryrefslogtreecommitdiffhomepage
path: root/gui/src
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2022-11-17 16:17:36 +0100
committerOskar Nyberg <oskar@mullvad.net>2022-11-24 16:26:28 +0100
commit83e0a8758668a803b3865d926579bb79d7df1415 (patch)
treeeced2449b86cb9da078bea46b57dde1a010bf5f7 /gui/src
parent27a09008679cd99cf4e78a8b9b630527f0e0f7f1 (diff)
downloadmullvadvpn-83e0a8758668a803b3865d926579bb79d7df1415.tar.xz
mullvadvpn-83e0a8758668a803b3865d926579bb79d7df1415.zip
Move relay filtering to filter-relays.ts
Diffstat (limited to 'gui/src')
-rw-r--r--gui/src/main/index.ts36
-rw-r--r--gui/src/main/relay-list.ts121
-rw-r--r--gui/src/renderer/app.tsx24
-rw-r--r--gui/src/renderer/components/Filter.tsx38
-rw-r--r--gui/src/renderer/components/select-location/select-location-hooks.ts23
-rw-r--r--gui/src/renderer/lib/filter-locations.ts58
-rw-r--r--gui/src/renderer/redux/settings/actions.ts16
-rw-r--r--gui/src/renderer/redux/settings/reducers.ts10
-rw-r--r--gui/src/shared/ipc-schema.ts13
9 files changed, 105 insertions, 234 deletions
diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts
index 94607766a0..320185abd8 100644
--- a/gui/src/main/index.ts
+++ b/gui/src/main/index.ts
@@ -7,7 +7,13 @@ import util from 'util';
import config from '../config.json';
import { hasExpired } from '../shared/account-expiry';
import { IWindowsApplication } from '../shared/application-types';
-import { DaemonEvent, DeviceEvent, ISettings, TunnelState } from '../shared/daemon-rpc-types';
+import {
+ DaemonEvent,
+ DeviceEvent,
+ IRelayListWithEndpointData,
+ ISettings,
+ TunnelState,
+} from '../shared/daemon-rpc-types';
import { messages, relayLocations } from '../shared/gettext';
import { SYSTEM_PREFERRED_LOCALE_KEY } from '../shared/gui-settings-state';
import { ITranslations, MacOsScrollbarVisibility } from '../shared/ipc-schema';
@@ -40,7 +46,6 @@ import NotificationController, {
} from './notification-controller';
import * as problemReport from './problem-report';
import ReconnectionBackoff from './reconnection-backoff';
-import RelayList from './relay-list';
import Settings, { SettingsDelegate } from './settings';
import TunnelStateHandler, {
TunnelStateHandlerDelegate,
@@ -75,7 +80,6 @@ class ApplicationMain
private notificationController = new NotificationController(this);
private version = new Version(this, this.daemonRpc, UPDATE_NOTIFICATION_DISABLED);
private settings = new Settings(this, this.daemonRpc, this.version.currentVersion);
- private relayList = new RelayList();
private userInterface?: UserInterface;
private account: Account = new Account(this, this.daemonRpc);
private tunnelState = new TunnelStateHandler(this);
@@ -102,6 +106,8 @@ class ApplicationMain
private navigationHistory?: IHistoryObject;
+ private relayList?: IRelayListWithEndpointData;
+
public run() {
// Remove window animations to combat window flickering when opening window. Can be removed when
// this issue has been resolved: https://github.com/electron/electron/issues/12130
@@ -514,11 +520,7 @@ class ApplicationMain
// fetch relays
try {
- this.relayList.setRelays(
- await this.daemonRpc.getRelayLocations(),
- this.settings.relaySettings,
- this.settings.bridgeState,
- );
+ this.setRelayList(await this.daemonRpc.getRelayLocations());
} catch (e) {
const error = e as Error;
log.error(`Failed to fetch relay locations: ${error.message}`);
@@ -610,11 +612,7 @@ class ApplicationMain
} else if ('settings' in daemonEvent) {
this.setSettings(daemonEvent.settings);
} else if ('relayList' in daemonEvent) {
- this.relayList.setRelays(
- daemonEvent.relayList,
- this.settings.relaySettings,
- this.settings.bridgeState,
- );
+ IpcMainEventChannel.relays.notify?.(daemonEvent.relayList);
} else if ('appVersionInfo' in daemonEvent) {
this.version.setLatestVersion(daemonEvent.appVersionInfo);
} else if ('device' in daemonEvent) {
@@ -652,10 +650,11 @@ class ApplicationMain
if (windowsSplitTunneling) {
void this.updateSplitTunnelingApplications(newSettings.splitTunnel.appsList);
}
+ }
- // since settings can have the relay constraints changed, the relay
- // list should also be updated
- this.relayList.updateSettings(newSettings.relaySettings, newSettings.bridgeState);
+ private setRelayList(relayList: IRelayListWithEndpointData) {
+ this.relayList = relayList;
+ IpcMainEventChannel.relays.notify?.(relayList);
}
private async updateSplitTunnelingApplications(appList: string[]): Promise<void> {
@@ -677,10 +676,7 @@ class ApplicationMain
settings: this.settings.all,
isPerformingPostUpgrade: this.isPerformingPostUpgrade,
deviceState: this.account.deviceState,
- relayListPair: this.relayList.getProcessedRelays(
- this.settings.relaySettings,
- this.settings.bridgeState,
- ),
+ relayList: this.relayList,
currentVersion: this.version.currentVersion,
upgradeVersion: this.version.upgradeVersion,
guiSettings: this.settings.gui.state,
diff --git a/gui/src/main/relay-list.ts b/gui/src/main/relay-list.ts
deleted file mode 100644
index c7b4a1fff1..0000000000
--- a/gui/src/main/relay-list.ts
+++ /dev/null
@@ -1,121 +0,0 @@
-import {
- BridgeState,
- IRelayList,
- IRelayListWithEndpointData,
- liftConstraint,
- RelaySettings,
-} from '../shared/daemon-rpc-types';
-import { IRelayListPair } from '../shared/ipc-schema';
-import { IpcMainEventChannel } from './ipc-event-channel';
-
-export default class RelayList {
- private relays: IRelayListWithEndpointData = {
- relayList: {
- countries: [],
- },
- wireguardEndpointData: {
- portRanges: [],
- udp2tcpPorts: [],
- },
- };
-
- public setRelays(
- newRelayList: IRelayListWithEndpointData,
- relaySettings: RelaySettings,
- bridgeState: BridgeState,
- ) {
- this.relays = newRelayList;
-
- const processedRelays = this.processRelays(newRelayList, relaySettings, bridgeState);
- IpcMainEventChannel.relays.notify?.(processedRelays);
- }
-
- public updateSettings(relaySettings: RelaySettings, bridgeState: BridgeState) {
- this.setRelays(this.relays, relaySettings, bridgeState);
- }
-
- public getProcessedRelays(relaySettings: RelaySettings, bridgeState: BridgeState) {
- return this.processRelays(this.relays, relaySettings, bridgeState);
- }
-
- private processRelays(
- relayList: IRelayListWithEndpointData,
- relaySettings: RelaySettings,
- bridgeState: BridgeState,
- ): IRelayListPair {
- const filteredRelays = this.processRelaysForPresentation(relayList.relayList, relaySettings);
- const filteredBridges = this.processBridgesForPresentation(relayList.relayList, bridgeState);
-
- return {
- relays: filteredRelays,
- bridges: filteredBridges,
- wireguardEndpointData: relayList.wireguardEndpointData,
- };
- }
-
- private processRelaysForPresentation(
- relayList: IRelayList,
- relaySettings: RelaySettings,
- ): IRelayList {
- const tunnelProtocol =
- 'normal' in relaySettings ? liftConstraint(relaySettings.normal.tunnelProtocol) : undefined;
-
- const filteredCountries = relayList.countries
- .map((country) => ({
- ...country,
- cities: country.cities
- .map((city) => ({
- ...city,
- relays: city.relays.filter((relay) => {
- if (relay.endpointType != 'bridge') {
- switch (tunnelProtocol) {
- case 'openvpn':
- return relay.endpointType == 'openvpn';
-
- case 'wireguard':
- return relay.endpointType == 'wireguard';
-
- case 'any': {
- const useMultihop =
- 'normal' in relaySettings &&
- relaySettings.normal.wireguardConstraints.useMultihop;
- return !useMultihop || relay.endpointType == 'wireguard';
- }
- default:
- return false;
- }
- } else {
- return false;
- }
- }),
- }))
- .filter((city) => city.relays.length > 0),
- }))
- .filter((country) => country.cities.length > 0);
-
- return { countries: filteredCountries };
- }
-
- private processBridgesForPresentation(
- relayList: IRelayList,
- bridgeState: BridgeState,
- ): IRelayList {
- if (bridgeState === 'on') {
- const filteredCountries = relayList.countries
- .map((country) => ({
- ...country,
- cities: country.cities
- .map((city) => ({
- ...city,
- relays: city.relays.filter((relay) => relay.endpointType == 'bridge'),
- }))
- .filter((city) => city.relays.length > 0),
- }))
- .filter((country) => country.cities.length > 0);
-
- return { countries: filteredCountries };
- } else {
- return { countries: [] };
- }
- }
-}
diff --git a/gui/src/renderer/app.tsx b/gui/src/renderer/app.tsx
index 80e969a920..fc6a32aa87 100644
--- a/gui/src/renderer/app.tsx
+++ b/gui/src/renderer/app.tsx
@@ -15,6 +15,7 @@ import {
IDeviceRemoval,
IDnsOptions,
ILocation,
+ IRelayListWithEndpointData,
ISettings,
liftConstraint,
ObfuscationSettings,
@@ -24,7 +25,6 @@ import {
} from '../shared/daemon-rpc-types';
import { messages, relayLocations } from '../shared/gettext';
import { IGuiSettingsState, SYSTEM_PREFERRED_LOCALE_KEY } from '../shared/gui-settings-state';
-import { IRelayListPair } from '../shared/ipc-schema';
import { IChangelog, ICurrentAppVersionInfo, IHistoryObject } from '../shared/ipc-types';
import log, { ConsoleOutput } from '../shared/logging';
import { LogLevel } from '../shared/logging-types';
@@ -92,7 +92,7 @@ export default class AppRenderer {
private location?: Partial<ILocation>;
private lastDisconnectedLocation?: Partial<ILocation>;
- private relayListPair!: IRelayListPair;
+ private relayList?: IRelayListWithEndpointData;
private tunnelState!: TunnelState;
private settings!: ISettings;
private deviceState?: DeviceState;
@@ -150,7 +150,7 @@ export default class AppRenderer {
this.updateBlockedState(this.tunnelState, newSettings.blockWhenDisconnected);
});
- IpcRendererEventChannel.relays.listen((relayListPair: IRelayListPair) => {
+ IpcRendererEventChannel.relays.listen((relayListPair: IRelayListWithEndpointData) => {
this.setRelayListPair(relayListPair);
});
@@ -217,7 +217,7 @@ export default class AppRenderer {
this.setTunnelState(initialState.tunnelState);
this.updateBlockedState(initialState.tunnelState, initialState.settings.blockWhenDisconnected);
- this.setRelayListPair(initialState.relayListPair);
+ this.setRelayListPair(initialState.relayList);
this.setCurrentVersion(initialState.currentVersion);
this.setUpgradeVersion(initialState.upgradeVersion);
this.setGuiSettings(initialState.guiSettings);
@@ -827,20 +827,16 @@ export default class AppRenderer {
}
}
- private setRelayListPair(relayListPair: IRelayListPair) {
- this.relayListPair = relayListPair;
+ private setRelayListPair(relayListPair?: IRelayListWithEndpointData) {
+ this.relayList = relayListPair;
this.propagateRelayListPairToRedux();
}
private propagateRelayListPairToRedux() {
- const relays = this.relayListPair.relays.countries;
- const bridges = this.relayListPair.bridges.countries;
-
- this.reduxActions.settings.updateRelayLocations(relays);
- this.reduxActions.settings.updateBridgeLocations(bridges);
- this.reduxActions.settings.updateWireguardEndpointData(
- this.relayListPair.wireguardEndpointData,
- );
+ if (this.relayList) {
+ this.reduxActions.settings.updateRelayLocations(this.relayList.relayList.countries);
+ this.reduxActions.settings.updateWireguardEndpointData(this.relayList.wireguardEndpointData);
+ }
}
private setCurrentVersion(versionInfo: ICurrentAppVersionInfo) {
diff --git a/gui/src/renderer/components/Filter.tsx b/gui/src/renderer/components/Filter.tsx
index 4c0184bc24..ef3cb84ef2 100644
--- a/gui/src/renderer/components/Filter.tsx
+++ b/gui/src/renderer/components/Filter.tsx
@@ -5,9 +5,9 @@ import { colors } from '../../config.json';
import { Ownership } from '../../shared/daemon-rpc-types';
import { messages } from '../../shared/gettext';
import { useAppContext } from '../context';
-import { filterLocations } from '../lib/filter-locations';
+import { EndpointType, filterLocations } from '../lib/filter-locations';
import { useHistory } from '../lib/history';
-import { useBoolean } from '../lib/utilityHooks';
+import { useBoolean, useNormalRelaySettings } from '../lib/utilityHooks';
import { IRelayLocationRedux } from '../redux/settings/reducers';
import { IReduxState, useSelector } from '../redux/store';
import Accordion from './Accordion';
@@ -111,19 +111,25 @@ export default function Filter() {
// Returns only the options for each filter that are compatible with current filter selection.
function useFilteredFilters(providers: string[], ownership: Ownership) {
- const locations = useSelector((state) =>
- state.settings.relayLocations.concat(
- state.settings.bridgeState === 'on' ? state.settings.bridgeLocations : [],
- ),
- );
+ const relaySettings = useNormalRelaySettings();
+ const bridgeState = useSelector((state) => state.settings.bridgeState);
+ const locations = useSelector((state) => state.settings.relayLocations);
+
+ const endpointType = bridgeState === 'on' ? EndpointType.any : EndpointType.exit;
const availableProviders = useMemo(() => {
- const filteredRelays = filterLocations(locations, [], ownership);
+ const filteredRelays = filterLocations(locations, endpointType, relaySettings, ownership, []);
return providersFromRelays(filteredRelays);
}, [locations, ownership]);
const availableOwnershipOptions = useMemo(() => {
- const filteredRelays = filterLocations(locations, providers, Ownership.any);
+ const filteredRelays = filterLocations(
+ locations,
+ endpointType,
+ relaySettings,
+ Ownership.any,
+ providers,
+ );
const filteredRelayOwnership = filteredRelays.flatMap((country) =>
country.cities.flatMap((city) => city.relays.map((relay) => relay.owned)),
);
@@ -151,11 +157,17 @@ function providersFromRelays(relays: IRelayLocationRedux[]) {
}
function providersSelector(state: IReduxState): Record<string, boolean> {
- const providerConstraint =
- 'normal' in state.settings.relaySettings ? state.settings.relaySettings.normal.providers : [];
+ const relaySettings =
+ 'normal' in state.settings.relaySettings ? state.settings.relaySettings.normal : undefined;
+ const providerConstraint = relaySettings?.providers ?? [];
- const relays = state.settings.relayLocations.concat(
- state.settings.bridgeState === 'on' ? state.settings.bridgeLocations : [],
+ const endpointType = state.settings.bridgeState === 'on' ? EndpointType.any : EndpointType.exit;
+ const relays = filterLocations(
+ state.settings.relayLocations,
+ endpointType,
+ relaySettings,
+ Ownership.any,
+ [],
);
const providers = providersFromRelays(relays);
diff --git a/gui/src/renderer/components/select-location/select-location-hooks.ts b/gui/src/renderer/components/select-location/select-location-hooks.ts
index 747dfac9c3..c42c5899c7 100644
--- a/gui/src/renderer/components/select-location/select-location-hooks.ts
+++ b/gui/src/renderer/components/select-location/select-location-hooks.ts
@@ -10,7 +10,7 @@ import log from '../../../shared/logging';
import RelaySettingsBuilder from '../../../shared/relay-settings-builder';
import { useAppContext } from '../../context';
import { createWireguardRelayUpdater } from '../../lib/constraint-updater';
-import { filterLocations } from '../../lib/filter-locations';
+import { EndpointType, filterLocations } from '../../lib/filter-locations';
import { useHistory } from '../../lib/history';
import { useNormalBridgeSettings, useNormalRelaySettings } from '../../lib/utilityHooks';
import { IRelayLocationRedux } from '../../redux/settings/reducers';
@@ -34,27 +34,16 @@ import {
} from './select-location-types';
import { useSelectLocationContext } from './SelectLocationContainer';
-function useFullRelayList(): Array<IRelayLocationRedux> {
- const { locationType } = useSelectLocationContext();
- const relaySettings = useNormalRelaySettings();
- const relayLocations = useSelector((state) => state.settings.relayLocations);
- const bridgeLocations = useSelector((state) => state.settings.bridgeLocations);
- return locationType === LocationType.entry && relaySettings?.tunnelProtocol === 'openvpn'
- ? bridgeLocations
- : relayLocations;
-}
-
// Return all locations that matches both the set filters and the search term.
function useFilteredRelays(): Array<IRelayLocationRedux> {
- const relayList = useFullRelayList();
+ const { locationType } = useSelectLocationContext();
+ const relayList = useSelector((state) => state.settings.relayLocations);
const relaySettings = useNormalRelaySettings();
+ const endpointType = locationType === LocationType.entry ? EndpointType.entry : EndpointType.exit;
const filteredRelayList = useMemo(
- () =>
- relaySettings
- ? filterLocations(relayList, relaySettings.providers, relaySettings.ownership)
- : relayList,
- [relaySettings, relayList, relaySettings?.providers, relaySettings?.ownership],
+ () => (relaySettings ? filterLocations(relayList, endpointType, relaySettings) : relayList),
+ [relaySettings, relayList, endpointType],
);
return filteredRelayList;
diff --git a/gui/src/renderer/lib/filter-locations.ts b/gui/src/renderer/lib/filter-locations.ts
index f9e78e40b1..c1ea17106f 100644
--- a/gui/src/renderer/lib/filter-locations.ts
+++ b/gui/src/renderer/lib/filter-locations.ts
@@ -1,29 +1,57 @@
-import { Ownership, RelayLocation } from '../../shared/daemon-rpc-types';
+import { Ownership, RelayEndpointType, RelayLocation } from '../../shared/daemon-rpc-types';
import {
IRelayLocationCityRedux,
IRelayLocationRedux,
IRelayLocationRelayRedux,
+ NormalRelaySettingsRedux,
} from '../redux/settings/reducers';
+export enum EndpointType {
+ any,
+ entry,
+ exit,
+}
+
export function filterLocations(
locations: IRelayLocationRedux[],
- providers: string[],
- ownership: Ownership,
+ endpointType: EndpointType,
+ relaySettings?: NormalRelaySettingsRedux,
+ ownership?: Ownership,
+ providers?: Array<string>,
): IRelayLocationRedux[] {
- const locationsFilteredByOwnership = filterLocationsByOwnership(locations, ownership);
- const locationsFilteredByProvider = filterLocationsByProvider(
- locationsFilteredByOwnership,
- providers,
- );
+ const byTunnelProtocol = filterByTunnelProtocol(locations, endpointType, relaySettings);
+ const byOwnership = filterByOwnership(byTunnelProtocol, ownership ?? relaySettings?.ownership);
+ const byProvider = filterByProvider(byOwnership, providers ?? relaySettings?.providers);
+
+ return byProvider;
+}
+
+function filterByTunnelProtocol(
+ locations: IRelayLocationRedux[],
+ endpointType: EndpointType,
+ relaySettings?: NormalRelaySettingsRedux,
+) {
+ const tunnelProtocol = relaySettings?.tunnelProtocol ?? 'any';
+ const endpointTypes: Array<RelayEndpointType> = [];
+ if (endpointType !== EndpointType.exit && tunnelProtocol === 'openvpn') {
+ endpointTypes.push('bridge');
+ } else if (tunnelProtocol === 'any') {
+ endpointTypes.push('wireguard');
+ if (!relaySettings?.wireguard.useMultihop) {
+ endpointTypes.push('openvpn');
+ }
+ } else {
+ endpointTypes.push(tunnelProtocol);
+ }
- return locationsFilteredByProvider;
+ return filterLocationsImpl(locations, (relay) => endpointTypes.includes(relay.endpointType));
}
-function filterLocationsByOwnership(
+function filterByOwnership(
locations: IRelayLocationRedux[],
- ownership: Ownership,
+ ownership?: Ownership,
): IRelayLocationRedux[] {
- if (ownership === Ownership.any) {
+ if (ownership === undefined || ownership === Ownership.any) {
return locations;
}
@@ -31,11 +59,11 @@ function filterLocationsByOwnership(
return filterLocationsImpl(locations, (relay) => relay.owned === expectOwned);
}
-function filterLocationsByProvider(
+function filterByProvider(
locations: IRelayLocationRedux[],
- providers: string[],
+ providers?: string[],
): IRelayLocationRedux[] {
- return providers.length === 0
+ return providers === undefined || providers.length === 0
? locations
: filterLocationsImpl(locations, (relay) => providers.includes(relay.provider));
}
diff --git a/gui/src/renderer/redux/settings/actions.ts b/gui/src/renderer/redux/settings/actions.ts
index c6e5aed985..ef03ce14b8 100644
--- a/gui/src/renderer/redux/settings/actions.ts
+++ b/gui/src/renderer/redux/settings/actions.ts
@@ -23,11 +23,6 @@ export interface IUpdateRelayLocationsAction {
relayLocations: IRelayLocationRedux[];
}
-export interface IUpdateBridgeLocationsAction {
- type: 'UPDATE_BRIDGE_LOCATIONS';
- bridgeLocations: IRelayLocationRedux[];
-}
-
export interface IUpdateWireguardEndpointData {
type: 'UPDATE_WIREGUARD_ENDPOINT_DATA';
wireguardEndpointData: IWireguardEndpointData;
@@ -102,7 +97,6 @@ export type SettingsAction =
| IUpdateGuiSettingsAction
| IUpdateRelayAction
| IUpdateRelayLocationsAction
- | IUpdateBridgeLocationsAction
| IUpdateWireguardEndpointData
| IUpdateAllowLanAction
| IUpdateEnableIpv6Action
@@ -139,15 +133,6 @@ function updateRelayLocations(relayLocations: IRelayLocationRedux[]): IUpdateRel
};
}
-function updateBridgeLocations(
- bridgeLocations: IRelayLocationRedux[],
-): IUpdateBridgeLocationsAction {
- return {
- type: 'UPDATE_BRIDGE_LOCATIONS',
- bridgeLocations,
- };
-}
-
function updateWireguardEndpointData(
wireguardEndpointData: IWireguardEndpointData,
): IUpdateWireguardEndpointData {
@@ -258,7 +243,6 @@ export default {
updateGuiSettings,
updateRelay,
updateRelayLocations,
- updateBridgeLocations,
updateWireguardEndpointData,
updateAllowLan,
updateEnableIpv6,
diff --git a/gui/src/renderer/redux/settings/reducers.ts b/gui/src/renderer/redux/settings/reducers.ts
index dfa68b97c8..2d1d287f00 100644
--- a/gui/src/renderer/redux/settings/reducers.ts
+++ b/gui/src/renderer/redux/settings/reducers.ts
@@ -9,6 +9,7 @@ import {
ObfuscationType,
Ownership,
ProxySettings,
+ RelayEndpointType,
RelayLocation,
RelayProtocol,
TunnelProtocol,
@@ -65,6 +66,7 @@ export interface IRelayLocationRelayRedux {
active: boolean;
owned: boolean;
weight: number;
+ endpointType: RelayEndpointType;
}
export interface IRelayLocationCityRedux {
@@ -86,7 +88,6 @@ export interface ISettingsReduxState {
guiSettings: IGuiSettingsState;
relaySettings: RelaySettingsRedux;
relayLocations: IRelayLocationRedux[];
- bridgeLocations: IRelayLocationRedux[];
wireguardEndpointData: IWireguardEndpointData;
allowLan: boolean;
enableIpv6: boolean;
@@ -132,7 +133,6 @@ const initialState: ISettingsReduxState = {
},
},
relayLocations: [],
- bridgeLocations: [],
wireguardEndpointData: { portRanges: [], udp2tcpPorts: [] },
allowLan: false,
enableIpv6: true,
@@ -192,12 +192,6 @@ export default function (
relayLocations: action.relayLocations,
};
- case 'UPDATE_BRIDGE_LOCATIONS':
- return {
- ...state,
- bridgeLocations: action.bridgeLocations,
- };
-
case 'UPDATE_WIREGUARD_ENDPOINT_DATA':
return {
...state,
diff --git a/gui/src/shared/ipc-schema.ts b/gui/src/shared/ipc-schema.ts
index 210e85e007..21d7b6216d 100644
--- a/gui/src/shared/ipc-schema.ts
+++ b/gui/src/shared/ipc-schema.ts
@@ -13,9 +13,8 @@ import {
IDeviceRemoval,
IDnsOptions,
ILocation,
- IRelayList,
+ IRelayListWithEndpointData,
ISettings,
- IWireguardEndpointData,
ObfuscationSettings,
RelaySettingsUpdate,
TunnelState,
@@ -42,12 +41,6 @@ export interface ITranslations {
relayLocations?: GetTextTranslations;
}
-export interface IRelayListPair {
- relays: IRelayList;
- bridges: IRelayList;
- wireguardEndpointData: IWireguardEndpointData;
-}
-
export type LaunchApplicationResult = { success: true } | { error: string };
export enum MacOsScrollbarVisibility {
@@ -65,7 +58,7 @@ export interface IAppStateSnapshot {
settings: ISettings;
isPerformingPostUpgrade: boolean;
deviceState?: DeviceState;
- relayListPair: IRelayListPair;
+ relayList?: IRelayListWithEndpointData;
currentVersion: ICurrentAppVersionInfo;
upgradeVersion: IAppVersionInfo;
guiSettings: IGuiSettingsState;
@@ -135,7 +128,7 @@ export const ipcSchema = {
disconnected: notifyRenderer<void>(),
},
relays: {
- '': notifyRenderer<IRelayListPair>(),
+ '': notifyRenderer<IRelayListWithEndpointData>(),
},
currentVersion: {
'': notifyRenderer<ICurrentAppVersionInfo>(),