From 118bff006f50d343bb426c3df77321c35d3349e7 Mon Sep 17 00:00:00 2001 From: Oriol Raventos Date: Mon, 18 Nov 2024 10:30:56 +0100 Subject: [PATCH] refactor(botonic-react): avoid cheking tow times if Cover exists --- .../botonic-react/src/webchat/cover-component/index.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/botonic-react/src/webchat/cover-component/index.tsx b/packages/botonic-react/src/webchat/cover-component/index.tsx index e18b34191..940d67280 100644 --- a/packages/botonic-react/src/webchat/cover-component/index.tsx +++ b/packages/botonic-react/src/webchat/cover-component/index.tsx @@ -23,11 +23,9 @@ export const CoverComponent = ({ component, componentProps }: Props) => { toggleCoverComponent(false) } - if (!Cover) { + if (!Cover || !webchatState.isCoverComponentOpen) { return null } - return Cover && webchatState.isCoverComponentOpen ? ( - - ) : null + return }