From e9c24e72ccf7e0661cdd97ff484eb36147564b1e Mon Sep 17 00:00:00 2001 From: Jan-Erik S <6697396+Bhavatu@users.noreply.github.com> Date: Mon, 21 Oct 2024 11:41:17 +0300 Subject: [PATCH] refactor --- components/common/FeedbackForm.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/common/FeedbackForm.js b/components/common/FeedbackForm.js index 675ff096..0e2a089d 100644 --- a/components/common/FeedbackForm.js +++ b/components/common/FeedbackForm.js @@ -83,7 +83,13 @@ const FeedbackForm = ({ if (Array.isArray(value)) { return value.length === 0; } - return value === '' || value === null || value === undefined; + if (value == null) { + return true; + } + if (typeof value === 'string') { + return value.trim() === ''; + } + return false; } );