Skip to content

Commit

Permalink
[FIX] Reduce re-subscription on notify-room/user-activity stream ev…
Browse files Browse the repository at this point in the history
…ent (#27911)
  • Loading branch information
tassoevan authored Feb 1, 2023
1 parent ea59e1d commit b199cd3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/meteor/client/views/room/providers/RoomProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,10 @@ const RoomProvider = ({ rid, children }: RoomProviderProps): ReactElement => {
};
}, [rid]);

const subscribed = !!subscriptionQuery.data;

useEffect(() => {
if (!subscriptionQuery.data) {
if (!subscribed) {
return;
}

Expand All @@ -95,7 +97,7 @@ const RoomProvider = ({ rid, children }: RoomProviderProps): ReactElement => {
// Do nothing
}
};
}, [rid, subscriptionQuery.data]);
}, [rid, subscribed]);

const api = useMemo(() => ({}), []);

Expand Down

0 comments on commit b199cd3

Please sign in to comment.