Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions app/definitions/IRoom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export interface IRoom {
muted?: string[];
teamId?: string;
ignored?: string;
joinCodeRequired?: boolean;
Comment thread
AlexAlexandre marked this conversation as resolved.
}

export enum OmnichannelSourceType {
Expand Down
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
21 changes: 12 additions & 9 deletions app/views/TeamChannelsView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import RoomHeader from '../containers/RoomHeader';
import SafeAreaView from '../containers/SafeAreaView';
import SearchHeader from '../containers/SearchHeader';
import StatusBar from '../containers/StatusBar';
import { IApplicationState, IBaseScreen } from '../definitions';
import { IApplicationState, IBaseScreen, IRoom } from '../definitions';
import { ERoomType } from '../definitions/ERoomType';
import { withDimensions } from '../dimensions';
import I18n from '../i18n';
Expand Down Expand Up @@ -348,14 +348,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 = {} as Partial<IRoom>;
Comment thread
AlexAlexandre marked this conversation as resolved.
Outdated
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