summaryrefslogtreecommitdiffhomepage
path: root/gui/src/renderer/components
diff options
context:
space:
mode:
authorJonathan <jonathan@mullvad.net>2024-01-03 14:39:12 +0100
committerJonathan <jonathan@mullvad.net>2024-01-03 14:39:12 +0100
commit711d4e439866ab12e03d33d5efae3c2355c0c229 (patch)
tree80d3a23c1a96bd3d80e05ac66b530e39c252d48a /gui/src/renderer/components
parentc510df96772b1e4ab7998e739ced42806c78e931 (diff)
parent4fdc34acbba60d5092e45ce3e513d30ec996c317 (diff)
downloadmullvadvpn-711d4e439866ab12e03d33d5efae3c2355c0c229.tar.xz
mullvadvpn-711d4e439866ab12e03d33d5efae3c2355c0c229.zip
Merge branch 'implement-custom-openvpn-socks5-bridge-client-in-daemon-des-430'
Diffstat (limited to 'gui/src/renderer/components')
-rw-r--r--gui/src/renderer/components/select-location/select-location-hooks.ts14
1 files changed, 10 insertions, 4 deletions
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 48d81e594c..b795f4a74f 100644
--- a/gui/src/renderer/components/select-location/select-location-hooks.ts
+++ b/gui/src/renderer/components/select-location/select-location-hooks.ts
@@ -11,6 +11,7 @@ import log from '../../../shared/logging';
import { useAppContext } from '../../context';
import { useRelaySettingsModifier } from '../../lib/constraint-updater';
import { useHistory } from '../../lib/history';
+import { useSelector } from '../../redux/store';
import { LocationType, SpecialBridgeLocationType } from './select-location-types';
import { useSelectLocationContext } from './SelectLocationContainer';
@@ -88,6 +89,7 @@ function useOnSelectLocation() {
export function useOnSelectBridgeLocation() {
const { updateBridgeSettings } = useAppContext();
const { setLocationType } = useSelectLocationContext();
+ const bridgeSettings = useSelector((state) => state.settings.bridgeSettings);
const setLocation = useCallback(async (bridgeUpdate: BridgeSettings) => {
if (bridgeUpdate) {
@@ -101,10 +103,14 @@ export function useOnSelectBridgeLocation() {
}
}, []);
- const onSelectRelay = useCallback((location: RelayLocation) => {
- const bridgeUpdate = new BridgeSettingsBuilder().location.fromRaw(location).build();
- return setLocation(bridgeUpdate);
- }, []);
+ const onSelectRelay = useCallback(
+ (location: RelayLocation) => {
+ const bridgeUpdate = new BridgeSettingsBuilder().location.fromRaw(location).build();
+ bridgeUpdate.custom = bridgeSettings.custom;
+ return setLocation(bridgeUpdate);
+ },
+ [bridgeSettings],
+ );
const onSelectSpecial = useCallback((location: SpecialBridgeLocationType) => {
switch (location) {