mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 14:13:38 -05:00
Merge pull request #4015 from overleaf/msm-fix-chat-button-reset
Fixed `resetUnreadMessageCount` used instead of `markMessagesAsRead` GitOrigin-RevId: 8337afd73d8dff570a289e159847a1f6b4fd2fb2
This commit is contained in:
parent
62f3eb493e
commit
1c552cba92
1 changed files with 4 additions and 4 deletions
|
@ -26,7 +26,7 @@ const layoutContextPropTypes = {
|
|||
}
|
||||
|
||||
const chatContextPropTypes = {
|
||||
resetUnreadMessageCount: PropTypes.func.isRequired,
|
||||
markMessagesAsRead: PropTypes.func.isRequired,
|
||||
unreadMessageCount: PropTypes.number.isRequired,
|
||||
}
|
||||
|
||||
|
@ -55,16 +55,16 @@ function EditorNavigationToolbarRoot({
|
|||
pdfLayout,
|
||||
} = useLayoutContext(layoutContextPropTypes)
|
||||
|
||||
const { resetUnreadMessageCount, unreadMessageCount } = useChatContext(
|
||||
const { markMessagesAsRead, unreadMessageCount } = useChatContext(
|
||||
chatContextPropTypes
|
||||
)
|
||||
|
||||
const toggleChatOpen = useCallback(() => {
|
||||
if (!chatIsOpen) {
|
||||
resetUnreadMessageCount()
|
||||
markMessagesAsRead()
|
||||
}
|
||||
setChatIsOpen(value => !value)
|
||||
}, [chatIsOpen, setChatIsOpen, resetUnreadMessageCount])
|
||||
}, [chatIsOpen, setChatIsOpen, markMessagesAsRead])
|
||||
|
||||
const toggleReviewPanelOpen = useCallback(
|
||||
() => setReviewPanelOpen(value => !value),
|
||||
|
|
Loading…
Reference in a new issue