Skip to content

Commit

Permalink
debug side drawer open comments use effect
Browse files Browse the repository at this point in the history
  • Loading branch information
OlegMoshkovich committed Sep 5, 2022
1 parent 8d18887 commit 8a512d3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Components/SideDrawer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,14 +99,16 @@ export default function SideDrawerWrapper() {
if (issueHash !== undefined) {
const extractedCommentId = issueHash.split(':')[1]
setSelectedIssueId(Number(extractedCommentId))
openDrawer()
turnCommentsOn()
if (!isDrawerOpen) {
openDrawer()
turnCommentsOn()
}
}
// This address bug #314 by clearing selected issue when new model is loaded
if (issueHash === undefined && isDrawerOpen) {
setSelectedIssueId(null)
}
}, [location, openDrawer, setSelectedIssueId, turnCommentsOn, isDrawerOpen])
}, [location, openDrawer, setSelectedIssueId])


return (
Expand Down

0 comments on commit 8a512d3

Please sign in to comment.