From a23a1171f0e212858ef11a59226a3ba897d4988e Mon Sep 17 00:00:00 2001 From: Arpit Date: Wed, 11 Oct 2023 13:41:25 +0530 Subject: [PATCH] fixes: widget inspector going to empty component (#7768) --- frontend/src/Editor/EditorFunc.jsx | 45 ++++++++++++++---------------- 1 file changed, 21 insertions(+), 24 deletions(-) diff --git a/frontend/src/Editor/EditorFunc.jsx b/frontend/src/Editor/EditorFunc.jsx index c64a5fb5f6..e24a0abf8f 100644 --- a/frontend/src/Editor/EditorFunc.jsx +++ b/frontend/src/Editor/EditorFunc.jsx @@ -1557,6 +1557,13 @@ const EditorComponent = (props) => { ); } + + const shouldrenderWidgetInspector = + currentSidebarTab === 1 && + selectedComponents?.length === 1 && + !isEmpty(appDefinition?.pages[currentPageId]?.components) && + !isEmpty(appDefinition?.pages[currentPageId]?.components[selectedComponents[0]?.id]); + return (
{ removeMultipleComponents={removeComponents} /> - {currentSidebarTab === 1 && ( + {shouldrenderWidgetInspector ? (
- {selectedComponents.length === 1 && - !isEmpty(appDefinition?.pages[currentPageId]?.components) && - !isEmpty(appDefinition?.pages[currentPageId]?.components[selectedComponents[0]?.id]) && ( - - )} +
- )} - - {(selectedComponents.length > 1 || currentSidebarTab === 2) && ( - + ) : ( + )}
{config.COMMENT_FEATURE_ENABLE && showComments && (