summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTobias Järvelöv <tobias.jarvelov@mullvad.net>2026-04-13 15:14:07 +0200
committerTobias Järvelöv <tobias.jarvelov@mullvad.net>2026-04-13 15:14:07 +0200
commit6762ea3f3e734a88dbde63325b18e0b1fda81bb5 (patch)
treed811834927a16e7a9ea5a5c6d9bee12c48d4d542
parent8ef3a3567f3ad19b70772c6099ecbfb395a121e3 (diff)
parent6c9553ef2194842fa784fbce4941a670a6c799b5 (diff)
downloadmullvadvpn-6762ea3f3e734a88dbde63325b18e0b1fda81bb5.tar.xz
mullvadvpn-6762ea3f3e734a88dbde63325b18e0b1fda81bb5.zip
Merge branch 'enabling-and-disabling-multihop-keeps-location-state-in-des-2944'
-rw-r--r--desktop/packages/mullvad-vpn/src/renderer/components/views/select-location/SelectLocationViewContext.tsx27
1 files changed, 14 insertions, 13 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/views/select-location/SelectLocationViewContext.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/views/select-location/SelectLocationViewContext.tsx
index ee4b54d65a..94fe41673e 100644
--- a/desktop/packages/mullvad-vpn/src/renderer/components/views/select-location/SelectLocationViewContext.tsx
+++ b/desktop/packages/mullvad-vpn/src/renderer/components/views/select-location/SelectLocationViewContext.tsx
@@ -40,19 +40,29 @@ export const useSelectLocationViewContext = (): SelectLocationViewContextProps =
type SelectLocationViewProviderProps = React.PropsWithChildren;
export function SelectLocationViewProvider({ children }: SelectLocationViewProviderProps) {
- const locationTypeSelector = useSelector((state) => state.userInterface.selectLocationView);
const { setSelectLocationView } = useActions(userInterface);
const [searchTerm, setSearchTerm] = React.useState('');
const relaySettings = useNormalRelaySettings();
- const selectedLocation = useSelectedLocation(locationTypeSelector);
+ const locationTypeSelector = useSelector((state) => state.userInterface.selectLocationView);
+
+ const locationType = React.useMemo(() => {
+ const allowEntryLocations = relaySettings?.wireguard.useMultihop;
+
+ if (allowEntryLocations) {
+ return locationTypeSelector;
+ }
+ return LocationType.exit;
+ }, [locationTypeSelector, relaySettings]);
- const filteredCountries = useFilterCountryLocations(locationTypeSelector);
+ const filteredCountries = useFilterCountryLocations(locationType);
const filteredCountryLocations = useMapReduxCountriesToCountryLocations(
- locationTypeSelector,
+ locationType,
filteredCountries,
);
const searchedCountryLocations = useSearchCountryLocations(filteredCountryLocations, searchTerm);
+ const selectedLocation = useSelectedLocation(locationType);
+
const filteredCustomListLocations = useMapCustomListsToLocations(
searchedCountryLocations,
searchTerm,
@@ -63,15 +73,6 @@ export function SelectLocationViewProvider({ children }: SelectLocationViewProvi
searchTerm,
);
- const locationType = React.useMemo(() => {
- const allowEntryLocations = relaySettings?.wireguard.useMultihop;
-
- if (allowEntryLocations) {
- return locationTypeSelector;
- }
- return LocationType.exit;
- }, [locationTypeSelector, relaySettings]);
-
const value = React.useMemo(
() => ({
locationType,