Skip to content

Commit 7edfe59

Browse files
refactor: improve code clarity
1 parent 4b2ce6e commit 7edfe59

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

apps/meteor/client/views/room/hooks/useRoomInvitation.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,10 @@ export const useRoomInvitation = (room: IRoomWithFederationOriginalName) => {
4949
return;
5050
}
5151

52-
if (event !== 'removed' && data.status !== undefined) {
53-
return;
52+
// Only invalidate when subscription is removed OR invite is accepted (status cleared)
53+
if (event === 'removed' || data.status === undefined) {
54+
await invalidateQueries();
5455
}
55-
56-
await invalidateQueries();
5756
});
5857
}, [room._id, user._id, invalidateQueries, replyInvite.isPending, subscribeToNotifyUser]);
5958

0 commit comments

Comments
 (0)