diff options
| author | Oskar Nyberg <oskar@mullvad.net> | 2021-09-08 20:30:35 +0200 |
|---|---|---|
| committer | Oskar Nyberg <oskar@mullvad.net> | 2021-09-09 15:34:10 +0200 |
| commit | 758ad18921e11ccade8bd166b99fded909bd3cc4 (patch) | |
| tree | ce646e7f64f8ae49637e652c2d89c06f05619412 | |
| parent | 930727e94ebd780c91d5475f1147b60621302eed (diff) | |
| download | mullvadvpn-758ad18921e11ccade8bd166b99fded909bd3cc4.tar.xz mullvadvpn-758ad18921e11ccade8bd166b99fded909bd3cc4.zip | |
Add missing hook dependency for setCustomDnsEnabled
| -rw-r--r-- | gui/src/renderer/components/CustomDnsSettings.tsx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/gui/src/renderer/components/CustomDnsSettings.tsx b/gui/src/renderer/components/CustomDnsSettings.tsx index 9c8b952ec8..9db4637d44 100644 --- a/gui/src/renderer/components/CustomDnsSettings.tsx +++ b/gui/src/renderer/components/CustomDnsSettings.tsx @@ -58,17 +58,20 @@ export default function CustomDnsSettings() { setConfirmAction(undefined); }, [confirmAction]); - const setCustomDnsEnabled = useCallback(async (enabled: boolean) => { - if (dns.customOptions.addresses.length > 0) { - await setDnsOptions({ ...dns, state: enabled ? 'custom' : 'default' }); - } - if (enabled && dns.customOptions.addresses.length === 0) { - showInput(); - } - if (!enabled) { - hideInput(); - } - }, []); + const setCustomDnsEnabled = useCallback( + async (enabled: boolean) => { + if (dns.customOptions.addresses.length > 0) { + await setDnsOptions({ ...dns, state: enabled ? 'custom' : 'default' }); + } + if (enabled && dns.customOptions.addresses.length === 0) { + showInput(); + } + if (!enabled) { + hideInput(); + } + }, + [dns], + ); // The input field should be hidden when it loses focus unless something on the same row or the // add-button is the new focused element. |
