diff options
| author | Oskar <oskar@mullvad.net> | 2024-09-17 13:40:28 +0200 |
|---|---|---|
| committer | Oskar <oskar@mullvad.net> | 2024-09-17 13:42:31 +0200 |
| commit | 861db773af743cb68dfce12f58bb58887c953930 (patch) | |
| tree | 3e6e6bde465e65b821382e102aa99d40bcb890f9 /gui/src | |
| parent | 656e5291469076a575efad8cfbb6d3256288821b (diff) | |
| download | mullvadvpn-861db773af743cb68dfce12f58bb58887c953930.tar.xz mullvadvpn-861db773af743cb68dfce12f58bb58887c953930.zip | |
Allow toggling connection island only when connected/connecting
Diffstat (limited to 'gui/src')
| -rw-r--r-- | gui/src/renderer/components/main-view/ConnectionPanel.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gui/src/renderer/components/main-view/ConnectionPanel.tsx b/gui/src/renderer/components/main-view/ConnectionPanel.tsx index 8754547e1f..5b4e576f76 100644 --- a/gui/src/renderer/components/main-view/ConnectionPanel.tsx +++ b/gui/src/renderer/components/main-view/ConnectionPanel.tsx @@ -68,7 +68,7 @@ const StyledConnectionStatusContainer = styled.div<{ })); export default function ConnectionPanel() { - const [expanded, expandImpl, collapse, toggleExpanded] = useBoolean(); + const [expanded, expandImpl, collapse, toggleExpandedImpl] = useBoolean(); const tunnelState = useSelector((state) => state.connection.status); const allowExpand = tunnelState.state === 'connected' || tunnelState.state === 'connecting'; @@ -79,6 +79,12 @@ export default function ConnectionPanel() { } }, [allowExpand, expandImpl]); + const toggleExpanded = useCallback(() => { + if (allowExpand) { + toggleExpandedImpl(); + } + }, [allowExpand, toggleExpandedImpl]); + const hasFeatureIndicators = allowExpand && tunnelState.featureIndicators !== undefined && |
