From e9e0b7c4f907dd37e35511639caca0a88779bd0f Mon Sep 17 00:00:00 2001
From: Ildar Kamalov <ik@adguard.com>
Date: Wed, 6 Apr 2022 19:27:24 +0300
Subject: [PATCH] Pull request: 700 validate only enabled encryption form

Merge in DNS/adguard-home from 700-validate to master

Updates #700.

Squashed commit of the following:

commit 9cd9ff2d23352e00c7782cf68195809111c832e5
Author: Ildar Kamalov <ik@adguard.com>
Date:   Wed Apr 6 18:50:11 2022 +0300

    client: validate only enabled encryption form
---
 client/src/components/Settings/Encryption/index.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/client/src/components/Settings/Encryption/index.js b/client/src/components/Settings/Encryption/index.js
index 13f5c47c..bcd2d323 100644
--- a/client/src/components/Settings/Encryption/index.js
+++ b/client/src/components/Settings/Encryption/index.js
@@ -25,7 +25,9 @@ class Encryption extends Component {
 
     handleFormChange = debounce((values) => {
         const submitValues = this.getSubmitValues(values);
-        this.props.validateTlsConfig(submitValues);
+        if (submitValues.enabled) {
+            this.props.validateTlsConfig(submitValues);
+        }
     }, DEBOUNCE_TIMEOUT);
 
     getInitialValues = (data) => {