diff --git a/app/views/RoomActionsView/index.js b/app/views/RoomActionsView/index.js index 0c7267d0..77a4cc59 100644 --- a/app/views/RoomActionsView/index.js +++ b/app/views/RoomActionsView/index.js @@ -461,11 +461,16 @@ class RoomActionsView extends React.Component { const { navigation } = this.props; try { - const result = await RocketChat.teamListRoomsOfUser({ teamId: room.teamId, userId: room.u._id }); + const db = database.active; + const subCollection = db.get('subscriptions'); + const rooms = await subCollection.query( + Q.where('team_id', Q.eq(room.teamId)), + Q.where('team_main', Q.notEq(true)) + ); - if (result.rooms?.length) { - const teamChannels = result.rooms.map(r => ({ - rid: r._id, + if (rooms.length) { + const teamChannels = rooms.map(r => ({ + rid: r.id, name: r.name, teamId: r.teamId, alert: r.isLastOwner