diff options
Diffstat (limited to 'gui/src/renderer/components')
| -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. |
