summaryrefslogtreecommitdiffhomepage
path: root/gui/src
diff options
context:
space:
mode:
authorOskar Nyberg <oskar@mullvad.net>2021-09-09 15:35:12 +0200
committerOskar Nyberg <oskar@mullvad.net>2021-09-09 15:35:12 +0200
commit0aef41f6e2937581749c837f660c436785daf131 (patch)
treece646e7f64f8ae49637e652c2d89c06f05619412 /gui/src
parent930727e94ebd780c91d5475f1147b60621302eed (diff)
parent758ad18921e11ccade8bd166b99fded909bd3cc4 (diff)
downloadmullvadvpn-0aef41f6e2937581749c837f660c436785daf131.tar.xz
mullvadvpn-0aef41f6e2937581749c837f660c436785daf131.zip
Merge branch 'fix-missing-hook-dependency'
Diffstat (limited to 'gui/src')
-rw-r--r--gui/src/renderer/components/CustomDnsSettings.tsx25
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.