[FIX] Show alert `Not allowed` when click on a private channel that you 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>
This commit is contained in:
parent
5f2aba3d74
commit
abf3945f32
|
@ -282,21 +282,20 @@ class TeamChannelsView extends React.Component {
|
||||||
logEvent(events.TC_GO_ROOM);
|
logEvent(events.TC_GO_ROOM);
|
||||||
const { navigation, isMasterDetail } = this.props;
|
const { navigation, isMasterDetail } = this.props;
|
||||||
try {
|
try {
|
||||||
let params = {};
|
|
||||||
if (item.rid) {
|
|
||||||
params = item;
|
|
||||||
} else {
|
|
||||||
const { room } = await RocketChat.getRoomInfo(item._id);
|
const { room } = await RocketChat.getRoomInfo(item._id);
|
||||||
params = {
|
const params = {
|
||||||
rid: item._id, name: RocketChat.getRoomTitle(room), joinCodeRequired: room.joinCodeRequired, t: room.t, teamId: room.teamId
|
rid: item._id, name: RocketChat.getRoomTitle(room), joinCodeRequired: room.joinCodeRequired, t: room.t, teamId: room.teamId
|
||||||
};
|
};
|
||||||
}
|
|
||||||
if (isMasterDetail) {
|
if (isMasterDetail) {
|
||||||
navigation.pop();
|
navigation.pop();
|
||||||
}
|
}
|
||||||
goRoom({ item: params, isMasterDetail, navigationMethod: navigation.push });
|
goRoom({ item: params, isMasterDetail, navigationMethod: navigation.push });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// do nothing
|
if (e.data.error === 'not-allowed') {
|
||||||
|
showErrorAlert(I18n.t('error-not-allowed'));
|
||||||
|
} else {
|
||||||
|
showErrorAlert(e.data.error);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}, 1000, true);
|
}, 1000, true);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue