Skip to content

Commit

Permalink
fix: fix applicant messager drawer refusing to close in some cases (#…
Browse files Browse the repository at this point in the history
…3110) (HL-1345)

Closing the sidebar changed the isMessagesDrawerVisible value, which
was a dependency for the same useEffect that was responsible for
opening it upon the query parameter in the first place. Now that
function is isolated into its own useEffect and doesn't get rerun.
  • Loading branch information
EmiliaMakelaVincit authored Jun 25, 2024
1 parent 5ea5967 commit 13b4eee
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,13 @@ const useHeader = (): ExtendedComponentProps => {
if (isMessagesDrawerVisible && Number(unreadMessagesCount) > 0) {
setUnredMessagesCount(null);
}
}, [isMessagesDrawerVisible, unreadMessagesCount]);

useEffect(() => {
if (openDrawer) {
setMessagesDrawerVisiblity(true);
}
}, [isMessagesDrawerVisible, unreadMessagesCount, openDrawer]);
}, [openDrawer]);

const status = React.useMemo(
(): APPLICATION_STATUSES =>
Expand Down

0 comments on commit 13b4eee

Please sign in to comment.