diff options
| author | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-09-08 12:19:26 +0200 |
|---|---|---|
| committer | Tobias Järvelöv <tobias.jarvelov@mullvad.net> | 2025-09-18 13:06:33 +0200 |
| commit | b9d04a0b9136ac49271a886d67466c05830c977b (patch) | |
| tree | 4888bd003e8871db1bd14fe2eecc969f94b39998 | |
| parent | 183b5759ea34a7ee0fe86ef4479e9086fbccb2df (diff) | |
| download | mullvadvpn-b9d04a0b9136ac49271a886d67466c05830c977b.tar.xz mullvadvpn-b9d04a0b9136ac49271a886d67466c05830c977b.zip | |
Disable open file picker button if split tunneling unsupported
3 files changed, 13 insertions, 2 deletions
diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/OpenFilePickerButton.tsx b/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/OpenFilePickerButton.tsx index 0b7fe7bec1..5b570f10f2 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/OpenFilePickerButton.tsx +++ b/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/OpenFilePickerButton.tsx @@ -1,12 +1,13 @@ import { messages } from '../../../../../../../../shared/gettext'; import { Button } from '../../../../../../../lib/components'; -import { useLaunchWithFilePicker } from './hooks'; +import { useDisabled, useLaunchWithFilePicker } from './hooks'; export function OpenFilePickerButton() { + const disabled = useDisabled(); const launchWithFilePicker = useLaunchWithFilePicker(); return ( - <Button onClick={launchWithFilePicker}> + <Button disabled={disabled} onClick={launchWithFilePicker}> <Button.Text> { // TRANSLATORS: Button label for browsing applications with split tunneling. diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/hooks/index.ts b/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/hooks/index.ts index 502bc77f87..cc11951cd4 100644 --- a/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/hooks/index.ts +++ b/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/hooks/index.ts @@ -1 +1,2 @@ +export * from './use-disabled'; export * from './use-launch-with-file-picker'; diff --git a/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/hooks/use-disabled.ts b/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/hooks/use-disabled.ts new file mode 100644 index 0000000000..ea1146ab10 --- /dev/null +++ b/desktop/packages/mullvad-vpn/src/renderer/components/views/split-tunneling/components/linux-settings/components/open-file-picker-button/hooks/use-disabled.ts @@ -0,0 +1,9 @@ +import { useLinuxSettingsContext } from '../../../LinuxSettingsContext'; + +export function useDisabled() { + const { splitTunnelingSupported } = useLinuxSettingsContext(); + + const disabled = splitTunnelingSupported === false; + + return disabled; +} |
