Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/six-deers-dress.md
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions apps/meteor/client/views/room/RoomOpenerEmbedded.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand Down
Loading