summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorHank <hank@mullvad.net>2022-10-17 13:52:40 +0200
committerHank <hank@mullvad.net>2022-10-18 12:55:40 +0200
commit6082dc5bb6a02b95bef0b10bc9875328322fca80 (patch)
treee08a7b5bd1cb14a01d2c97c0ce1e93267c5c5149
parentd70b7bed11919c40f6f057b440bf65698cf2e11d (diff)
downloadmullvadvpn-6082dc5bb6a02b95bef0b10bc9875328322fca80.tar.xz
mullvadvpn-6082dc5bb6a02b95bef0b10bc9875328322fca80.zip
Simplify multihopEnabled
-rw-r--r--gui/src/renderer/containers/SelectLocationPage.tsx12
1 files changed, 5 insertions, 7 deletions
diff --git a/gui/src/renderer/containers/SelectLocationPage.tsx b/gui/src/renderer/containers/SelectLocationPage.tsx
index ab40b54810..c7ada77118 100644
--- a/gui/src/renderer/containers/SelectLocationPage.tsx
+++ b/gui/src/renderer/containers/SelectLocationPage.tsx
@@ -53,13 +53,11 @@ export default function SelectLocationPage() {
}, [tunnelProtocol, bridgeSettings]);
const multihopEnabled = useMemo(() => {
- if (
- !(tunnelProtocol === 'openvpn' && 'normal' in bridgeSettings) &&
- 'normal' in relaySettings
- ) {
- return relaySettings.normal.wireguard.useMultihop;
- }
- return false;
+ return (
+ tunnelProtocol !== 'openvpn' &&
+ 'normal' in relaySettings &&
+ relaySettings.normal.wireguard.useMultihop
+ );
}, [tunnelProtocol, relaySettings]);
const selectedEntryLocation = useMemo<RelayLocation | undefined>(() => {