Skip to content

Commit

Permalink
Merge branch 'daita-multihop-warning-is-shown-in-select-location-view…
Browse files Browse the repository at this point in the history
…-des-1506'
  • Loading branch information
hulthe committed Nov 27, 2024
2 parents f88c5ba + e9c6f50 commit 7ecd38c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ function SelectLocationContent() {
</>
);
} else if (relaySettings?.tunnelProtocol !== 'openvpn') {
if (daita && !directOnly) {
if (daita && !directOnly && relaySettings?.wireguard.useMultihop) {
return <DisabledEntrySelection />;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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],
);

Expand Down

0 comments on commit 7ecd38c

Please sign in to comment.