Skip to content

Commit

Permalink
[FIX] Show alert Not allowed when click on a private channel that y…
Browse files Browse the repository at this point in the history
…ou don't be invited before (#3177)

* [FIX] Showing only channel you joined

* [FIX] How to get the params to mnavigation to other room from TeamChannelList

* Show alert Not allowed when trying access private channel that you don't joined

Co-authored-by: Diego Mello <diegolmello@gmail.com>
  • Loading branch information
reinaldonetof and diegolmello authored Jun 4, 2021
1 parent 5f2aba3 commit abf3945
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions app/views/TeamChannelsView.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,21 +282,20 @@ class TeamChannelsView extends React.Component {
logEvent(events.TC_GO_ROOM);
const { navigation, isMasterDetail } = this.props;
try {
let params = {};
if (item.rid) {
params = item;
} else {
const { room } = await RocketChat.getRoomInfo(item._id);
params = {
rid: item._id, name: RocketChat.getRoomTitle(room), joinCodeRequired: room.joinCodeRequired, t: room.t, teamId: room.teamId
};
}
const { room } = await RocketChat.getRoomInfo(item._id);
const params = {
rid: item._id, name: RocketChat.getRoomTitle(room), joinCodeRequired: room.joinCodeRequired, t: room.t, teamId: room.teamId
};
if (isMasterDetail) {
navigation.pop();
}
goRoom({ item: params, isMasterDetail, navigationMethod: navigation.push });
} catch (e) {
// do nothing
if (e.data.error === 'not-allowed') {
showErrorAlert(I18n.t('error-not-allowed'));
} else {
showErrorAlert(e.data.error);
}
}
}, 1000, true);

Expand Down

0 comments on commit abf3945

Please sign in to comment.