From 531ad9b9b449382fe76c3641e253b9f00db6793e Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Wed, 23 Feb 2022 15:55:38 -0300 Subject: [PATCH] fix: fix mergeSubscriptionsRooms (#3770) --- app/lib/methods/helpers/mergeSubscriptionsRooms.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/methods/helpers/mergeSubscriptionsRooms.ts b/app/lib/methods/helpers/mergeSubscriptionsRooms.ts index a0fc7c4dd..4cca2707d 100644 --- a/app/lib/methods/helpers/mergeSubscriptionsRooms.ts +++ b/app/lib/methods/helpers/mergeSubscriptionsRooms.ts @@ -103,7 +103,7 @@ export default async (serverSubscriptions: IServerSubscription, serverRooms: ISe const findData = await findSubscriptionsRooms(subscriptions, rooms); // Merge each subscription into a room const mergedSubscriptions = findData.subscriptions.map(subscription => { - const index = findData.rooms.findIndex(({ _id }) => _id === subscription.rid); + const index = rooms.findIndex(({ _id }) => _id === subscription.rid); // Room not found if (index < 0) { return merge(subscription);