Skip to content

Commit 1caaf15

Browse files
committed
fix: only process healthcheck event on first connection
1 parent d71d10e commit 1caaf15

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

package/src/components/ChannelPreview/hooks/useIsChannelMuted.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,11 @@ export const useIsChannelMuted = (channel: Channel) => {
3131

3232
const listeners = [
3333
client.on('notification.channel_mutes_updated', handleEvent),
34-
client.on('health.check', handleEvent),
34+
client.on('health.check', (event) => {
35+
if (event.me) {
36+
handleEvent();
37+
}
38+
}),
3539
];
3640
return () => {
3741
listeners.forEach((listener) => listener.unsubscribe());

0 commit comments

Comments
 (0)