Revert "[IMPROVEMENT] Load team's rooms from local database on team leave (#3185)" (#3194)

This reverts commit fa00ef92ef.
This commit is contained in:
Diego Mello 2021-06-07 16:08:20 -03:00 committed by GitHub
parent ec97d8417f
commit dfe9e4fccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 9 deletions

View File

@ -436,16 +436,11 @@ class RoomActionsView extends React.Component {
const { navigation, leaveRoom } = this.props;
try {
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))
);
const result = await RocketChat.teamListRoomsOfUser({ teamId: room.teamId, userId: room.u._id });
if (rooms.length) {
const teamChannels = rooms.map(r => ({
rid: r.id,
if (result.rooms?.length) {
const teamChannels = result.rooms.map(r => ({
rid: r._id,
name: r.name,
teamId: r.teamId,
alert: r.isLastOwner