diff --git a/.changeset/thin-suns-invent.md b/.changeset/thin-suns-invent.md new file mode 100644 index 000000000000..945f44420797 --- /dev/null +++ b/.changeset/thin-suns-invent.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixes issues causing nonstop sound notification when taking a chat from the `Current Chats` view diff --git a/apps/meteor/client/views/room/body/hooks/useUnreadMessages.ts b/apps/meteor/client/views/room/body/hooks/useUnreadMessages.ts index 5e74164b7882..343b9cb88a98 100644 --- a/apps/meteor/client/views/room/body/hooks/useUnreadMessages.ts +++ b/apps/meteor/client/views/room/body/hooks/useUnreadMessages.ts @@ -93,9 +93,11 @@ export const useHandleUnread = ( const debouncedReadMessageRead = useMemo( () => withDebouncing({ wait: 500 })(() => { - chat.readStateManager.attemptMarkAsRead(); + if (subscribed) { + chat.readStateManager.attemptMarkAsRead(); + } }), - [chat.readStateManager], + [chat.readStateManager, subscribed], ); useEffect(