Skip to content
Snippets Groups Projects
Unverified Commit 43b3249a authored by dionisio-bot[bot]'s avatar dionisio-bot[bot] Committed by GitHub
Browse files

fix: Rooms not working in embedded layout (#35251)

parent 227d34ef
No related branches found
No related tags found
No related merge requests found
---
"@rocket.chat/meteor": patch
---
fixes an issue with embedded layout rooms displaying as if the user is not part of the room
......@@ -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) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment