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
36 changes: 19 additions & 17 deletions app/views/DirectoryView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -157,23 +157,25 @@ class DirectoryView extends React.Component<IDirectoryViewProps, any> {
this.goRoom({ rid: result.room._id, name: item.username, t: 'd' });
}
} else if (['p', 'c'].includes(item.t) && !item.teamMain) {
const { room }: any = await RocketChat.getRoomInfo(item._id);
this.goRoom({
rid: item._id,
name: item.name,
joinCodeRequired: room.joinCodeRequired,
t: item.t,
search: true
});
} else {
this.goRoom({
rid: item._id,
name: item.name,
t: item.t,
search: true,
teamMain: item.teamMain,
teamId: item.teamId
});
const result = await RocketChat.getRoomInfo(item._id);
if (result.success) {
this.goRoom({
rid: item._id,
name: item.name,
joinCodeRequired: result.room.joinCodeRequired,
t: item.t,
search: true
});
} else {
this.goRoom({
rid: item._id,
name: item.name,
t: item.t,
search: true,
teamMain: item.teamMain,
teamId: item.teamId
});
}
}
};

Expand Down
19 changes: 11 additions & 8 deletions app/views/TeamChannelsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -350,14 +350,17 @@ class TeamChannelsView extends React.Component<ITeamChannelsViewProps, ITeamChan
logEvent(events.TC_GO_ROOM);
const { navigation, isMasterDetail } = this.props;
try {
const { room } = (await RocketChat.getRoomInfo(item._id)) as any;
const params = {
rid: item._id,
name: RocketChat.getRoomTitle(room),
joinCodeRequired: room.joinCodeRequired,
t: room.t,
teamId: room.teamId
};
let params = {};
const result = await RocketChat.getRoomInfo(item._id);
if (result.success) {
params = {
rid: item._id,
name: RocketChat.getRoomTitle(result.room),
joinCodeRequired: result.room.joinCodeRequired,
t: result.room.t,
teamId: result.room.teamId
};
}
if (isMasterDetail) {
navigation.pop();
}
Expand Down