summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer
diff options
context:
space:
mode:
Diffstat (limited to 'gui/src/renderer')
-rw-r--r--gui/src/renderer/components/select-location/RelayListContext.tsx4
-rw-r--r--gui/src/renderer/components/select-location/SelectLocation.tsx2
-rw-r--r--gui/src/renderer/lib/filter-locations.ts6
3 files changed, 8 insertions, 4 deletions
diff --git a/gui/src/renderer/components/select-location/RelayListContext.tsx b/gui/src/renderer/components/select-location/RelayListContext.tsx
index 13156dd045..ba86709080 100644
--- a/gui/src/renderer/components/select-location/RelayListContext.tsx
+++ b/gui/src/renderer/components/select-location/RelayListContext.tsx
@@ -66,7 +66,6 @@ export function RelayListContextProvider(props: RelayListContextProviderProps) {
const fullRelayList = useSelector((state) => state.settings.relayLocations);
const relaySettings = useNormalRelaySettings();
- const multihop = relaySettings?.wireguard.useMultihop ?? false;
// Filters the relays to only keep the ones of the desired endpoint type, e.g. "wireguard",
// "openvpn" or "bridge"
@@ -79,7 +78,8 @@ export function RelayListContextProvider(props: RelayListContextProviderProps) {
const relayListForDaita = useMemo(() => {
return filterLocationsByDaita(
relayListForEndpointType,
- daita && (!useAnywhere || multihop),
+ daita,
+ useAnywhere,
locationType,
relaySettings?.tunnelProtocol ?? 'any',
relaySettings?.wireguard.useMultihop ?? false,
diff --git a/gui/src/renderer/components/select-location/SelectLocation.tsx b/gui/src/renderer/components/select-location/SelectLocation.tsx
index f6cf772019..36a69667da 100644
--- a/gui/src/renderer/components/select-location/SelectLocation.tsx
+++ b/gui/src/renderer/components/select-location/SelectLocation.tsx
@@ -68,8 +68,10 @@ export default function SelectLocation() {
const providers = relaySettings?.providers ?? [];
const filteredProviders = useFilteredProviders(providers, ownership);
const daita = useSelector((state) => state.settings.wireguard.daita?.enabled ?? false);
+ const useAnywhere = useSelector((state) => state.settings.wireguard.daita?.useAnywhere ?? false);
const showDaitaFilter = daitaFilterActive(
daita,
+ useAnywhere,
locationType,
relaySettings?.tunnelProtocol ?? 'any',
relaySettings?.wireguard.useMultihop ?? false,
diff --git a/gui/src/renderer/lib/filter-locations.ts b/gui/src/renderer/lib/filter-locations.ts
index 78126f1fb4..675a4fc88b 100644
--- a/gui/src/renderer/lib/filter-locations.ts
+++ b/gui/src/renderer/lib/filter-locations.ts
@@ -37,17 +37,19 @@ export function filterLocationsByEndPointType(
export function filterLocationsByDaita(
locations: IRelayLocationCountryRedux[],
daita: boolean,
+ useAnywhere: boolean,
locationType: LocationType,
tunnelProtocol: LiftedConstraint<TunnelProtocol>,
multihop: boolean,
): IRelayLocationCountryRedux[] {
- return daitaFilterActive(daita, locationType, tunnelProtocol, multihop)
+ return daitaFilterActive(daita, useAnywhere, locationType, tunnelProtocol, multihop)
? filterLocationsImpl(locations, (relay: IRelayLocationRelayRedux) => relay.daita)
: locations;
}
export function daitaFilterActive(
daita: boolean,
+ useAnywhere: boolean,
locationType: LocationType,
tunnelProtocol: LiftedConstraint<TunnelProtocol>,
multihop: boolean,
@@ -55,7 +57,7 @@ export function daitaFilterActive(
const isEntry = multihop
? locationType === LocationType.entry
: locationType === LocationType.exit;
- return daita && isEntry && tunnelProtocol !== 'openvpn';
+ return daita && (!useAnywhere || multihop) && isEntry && tunnelProtocol !== 'openvpn';
}
export function filterLocations(