From 9521463851df932b9baca04507f002a8c5cc8698 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 18 Dec 2024 11:49:43 -0300 Subject: [PATCH] fix: New room sound fired after reconnection (#34202) Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com> --- .changeset/wise-queens-build.md | 5 +++++ apps/meteor/client/hooks/useNotifyUser.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/wise-queens-build.md diff --git a/.changeset/wise-queens-build.md b/.changeset/wise-queens-build.md new file mode 100644 index 000000000000..51e54de4a6bd --- /dev/null +++ b/.changeset/wise-queens-build.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixes an issue where the notification sound was playing randomly diff --git a/apps/meteor/client/hooks/useNotifyUser.ts b/apps/meteor/client/hooks/useNotifyUser.ts index 5409963ce153..baa804908e8a 100644 --- a/apps/meteor/client/hooks/useNotifyUser.ts +++ b/apps/meteor/client/hooks/useNotifyUser.ts @@ -69,7 +69,7 @@ export const useNotifyUser = () => { }); const handle = CachedChatSubscription.collection.find().observe({ - changed: (sub) => { + added: (sub) => { void notifyNewRoom(sub); }, });