From 5eca8aeb2f94b75abad1bbade17ae631a8116ebb Mon Sep 17 00:00:00 2001 From: Joey Ballentine Date: Sun, 19 May 2024 12:12:02 -0400 Subject: [PATCH] Only trigger node doc search page open when doc page is open --- .../components/NodeDocumentation/NodeDocumentationModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer/components/NodeDocumentation/NodeDocumentationModal.tsx b/src/renderer/components/NodeDocumentation/NodeDocumentationModal.tsx index 5bd28a29c..920ac8f3f 100644 --- a/src/renderer/components/NodeDocumentation/NodeDocumentationModal.tsx +++ b/src/renderer/components/NodeDocumentation/NodeDocumentationModal.tsx @@ -100,7 +100,7 @@ const NodeDocumentationModal = memo(() => { // select highest scoring schema useEffect(() => { - if (searchScores && searchScores.size > 0) { + if (isOpen && searchScores && searchScores.size > 0) { const highestScore = Math.max(...searchScores.values()); const highestScoreSchemaId = [...searchScores.entries()].find( ([, score]) => score === highestScore @@ -109,7 +109,7 @@ const NodeDocumentationModal = memo(() => { openNodeDocumentation(highestScoreSchemaId); } } - }, [searchScores, openNodeDocumentation]); + }, [isOpen, searchScores, openNodeDocumentation]); return (