Skip to content

Commit

Permalink
Only trigger node doc search page open when doc page is open (#2883)
Browse files Browse the repository at this point in the history
  • Loading branch information
joeyballentine authored May 19, 2024
1 parent a9c6e50 commit c28ca19
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -109,7 +109,7 @@ const NodeDocumentationModal = memo(() => {
openNodeDocumentation(highestScoreSchemaId);
}
}
}, [searchScores, openNodeDocumentation]);
}, [isOpen, searchScores, openNodeDocumentation]);

return (
<Modal
Expand Down

0 comments on commit c28ca19

Please sign in to comment.