diff --git a/.changeset/six-deers-dress.md b/.changeset/six-deers-dress.md new file mode 100644 index 0000000000000..84842adb03151 --- /dev/null +++ b/.changeset/six-deers-dress.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixes an issue with embedded layout rooms displaying as if the user is not part of the room diff --git a/apps/meteor/client/views/room/RoomOpenerEmbedded.tsx b/apps/meteor/client/views/room/RoomOpenerEmbedded.tsx index d3ba7ef64e367..ad3cbe0a77731 100644 --- a/apps/meteor/client/views/room/RoomOpenerEmbedded.tsx +++ b/apps/meteor/client/views/room/RoomOpenerEmbedded.tsx @@ -43,7 +43,7 @@ const RoomOpenerEmbedded = ({ type, reference }: RoomOpenerProps): ReactElement const subscribeToNotifyUser = useStream('notify-user'); const rid = data?.rid; - const { data: subscription, refetch } = useQuery({ + const { data: subscriptionData, refetch } = useQuery({ queryKey: ['subscriptions', rid] as const, queryFn: () => { if (!rid) { @@ -55,13 +55,13 @@ const RoomOpenerEmbedded = ({ type, reference }: RoomOpenerProps): ReactElement }); useEffect(() => { - if (!subscription) { + if (!subscriptionData?.subscription) { return; } - CachedChatSubscription.upsertSubscription(subscription as unknown as ISubscription); + CachedChatSubscription.upsertSubscription(subscriptionData.subscription as unknown as ISubscription); LegacyRoomManager.computation.invalidate(); - }, [subscription]); + }, [subscriptionData]); useEffect(() => { if (!uid) {