diff --git a/app/views/DirectoryView/index.tsx b/app/views/DirectoryView/index.tsx index b4b0689bd..73e6a45c9 100644 --- a/app/views/DirectoryView/index.tsx +++ b/app/views/DirectoryView/index.tsx @@ -157,23 +157,25 @@ class DirectoryView extends React.Component { 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 + }); + } } }; diff --git a/app/views/TeamChannelsView.tsx b/app/views/TeamChannelsView.tsx index 5740f078d..b8b32cdd2 100644 --- a/app/views/TeamChannelsView.tsx +++ b/app/views/TeamChannelsView.tsx @@ -350,14 +350,17 @@ class TeamChannelsView extends React.Component