Chore: Migrate REST API - getRoomInfo to Typescript (#3823)
* chore: add rest api return * chore: add rest api return
This commit is contained in:
parent
1aab65ef92
commit
ccdbd9543c
|
@ -157,11 +157,12 @@ 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);
|
||||
const result = await RocketChat.getRoomInfo(item._id);
|
||||
if (result.success) {
|
||||
this.goRoom({
|
||||
rid: item._id,
|
||||
name: item.name,
|
||||
joinCodeRequired: room.joinCodeRequired,
|
||||
joinCodeRequired: result.room.joinCodeRequired,
|
||||
t: item.t,
|
||||
search: true
|
||||
});
|
||||
|
@ -175,6 +176,7 @@ class DirectoryView extends React.Component<IDirectoryViewProps, any> {
|
|||
teamId: item.teamId
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
renderHeader = () => {
|
||||
|
|
|
@ -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 = {
|
||||
let params = {};
|
||||
const result = await RocketChat.getRoomInfo(item._id);
|
||||
if (result.success) {
|
||||
params = {
|
||||
rid: item._id,
|
||||
name: RocketChat.getRoomTitle(room),
|
||||
joinCodeRequired: room.joinCodeRequired,
|
||||
t: room.t,
|
||||
teamId: room.teamId
|
||||
name: RocketChat.getRoomTitle(result.room),
|
||||
joinCodeRequired: result.room.joinCodeRequired,
|
||||
t: result.room.t,
|
||||
teamId: result.room.teamId
|
||||
};
|
||||
}
|
||||
if (isMasterDetail) {
|
||||
navigation.pop();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue