mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -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 = {
|
const chatContextPropTypes = {
|
||||||
resetUnreadMessageCount: PropTypes.func.isRequired,
|
markMessagesAsRead: PropTypes.func.isRequired,
|
||||||
unreadMessageCount: PropTypes.number.isRequired,
|
unreadMessageCount: PropTypes.number.isRequired,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -55,16 +55,16 @@ function EditorNavigationToolbarRoot({
|
||||||
pdfLayout,
|
pdfLayout,
|
||||||
} = useLayoutContext(layoutContextPropTypes)
|
} = useLayoutContext(layoutContextPropTypes)
|
||||||
|
|
||||||
const { resetUnreadMessageCount, unreadMessageCount } = useChatContext(
|
const { markMessagesAsRead, unreadMessageCount } = useChatContext(
|
||||||
chatContextPropTypes
|
chatContextPropTypes
|
||||||
)
|
)
|
||||||
|
|
||||||
const toggleChatOpen = useCallback(() => {
|
const toggleChatOpen = useCallback(() => {
|
||||||
if (!chatIsOpen) {
|
if (!chatIsOpen) {
|
||||||
resetUnreadMessageCount()
|
markMessagesAsRead()
|
||||||
}
|
}
|
||||||
setChatIsOpen(value => !value)
|
setChatIsOpen(value => !value)
|
||||||
}, [chatIsOpen, setChatIsOpen, resetUnreadMessageCount])
|
}, [chatIsOpen, setChatIsOpen, markMessagesAsRead])
|
||||||
|
|
||||||
const toggleReviewPanelOpen = useCallback(
|
const toggleReviewPanelOpen = useCallback(
|
||||||
() => setReviewPanelOpen(value => !value),
|
() => setReviewPanelOpen(value => !value),
|
||||||
|
|
Loading…
Reference in a new issue