diff options
| author | Joakim Hulthe <joakim.hulthe@mullvad.net> | 2024-11-27 17:08:43 +0100 |
|---|---|---|
| committer | Joakim Hulthe <joakim.hulthe@mullvad.net> | 2024-11-27 17:08:43 +0100 |
| commit | 7ecd38c3c61d1cee2fc4d052a78eb42b3e0c96a6 (patch) | |
| tree | ad6df75742f987138f3f8218b12151e604ad0b78 | |
| parent | f88c5baf5e3123f996f10b1255fb681d4b120677 (diff) | |
| parent | e9c6f50aa581956fff86d937d562d94397a6b1b3 (diff) | |
| download | mullvadvpn-7ecd38c3c61d1cee2fc4d052a78eb42b3e0c96a6.tar.xz mullvadvpn-7ecd38c3c61d1cee2fc4d052a78eb42b3e0c96a6.zip | |
Merge branch 'daita-multihop-warning-is-shown-in-select-location-view-des-1506'
3 files changed, 18 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index b38edcec39..addd434290 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ Line wrap the file at 100 chars. Th ### Fixed - Handle network switching better when using WG over Shadowsocks. +- Fix multihop entry location list sometimes being shown when multihop is disabled. #### macOS - Fix packets being duplicated on LAN when split tunneling is enabled. diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/select-location/SelectLocation.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/select-location/SelectLocation.tsx index d81a265072..4f2c830f28 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/select-location/SelectLocation.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/select-location/SelectLocation.tsx @@ -302,7 +302,7 @@ function SelectLocationContent() { </> ); } else if (relaySettings?.tunnelProtocol !== 'openvpn') { - if (daita && !directOnly) { + if (daita && !directOnly && relaySettings?.wireguard.useMultihop) { return <DisabledEntrySelection />; } diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/select-location/SelectLocationContainer.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/select-location/SelectLocationContainer.tsx index 66bebdf1b0..1c4c8e2349 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/select-location/SelectLocationContainer.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/select-location/SelectLocationContainer.tsx @@ -1,6 +1,7 @@ import React, { useContext, useMemo, useState } from 'react'; import useActions from '../../lib/actionsHook'; +import { useNormalRelaySettings } from '../../lib/relay-settings-hooks'; import { useSelector } from '../../redux/store'; import userInterface from '../../redux/userinterface/actions'; import { RelayListContextProvider } from './RelayListContext'; @@ -23,12 +24,25 @@ export function useSelectLocationContext() { } export default function SelectLocationContainer() { - const locationType = useSelector((state) => state.userInterface.selectLocationView); + const locationTypeSelector = useSelector((state) => state.userInterface.selectLocationView); const { setSelectLocationView } = useActions(userInterface); const [searchTerm, setSearchTerm] = useState(''); + const relaySettings = useNormalRelaySettings(); + + const locationType = useMemo(() => { + if (relaySettings?.wireguard.useMultihop) { + return locationTypeSelector; + } + return LocationType.exit; + }, [locationTypeSelector, relaySettings]); const value = useMemo( - () => ({ locationType, setLocationType: setSelectLocationView, searchTerm, setSearchTerm }), + () => ({ + locationType, + setLocationType: setSelectLocationView, + searchTerm, + setSearchTerm, + }), [locationType, searchTerm, setSelectLocationView], ); |
