Minor tweak

This commit is contained in:
Gerzon Z 2021-06-24 11:34:14 -04:00
parent f47a1a922c
commit f9662036fd
1 changed files with 15 additions and 1 deletions

View File

@ -69,6 +69,7 @@ import LoadMore from './LoadMore';
import RoomServices from './services';
import getThreadName from '../../lib/methods/getThreadName';
import getRoomInfo from '../../lib/methods/getRoomInfo';
import { goRoom } from '../../utils/goRoom';
const stateAttrsUpdate = [
'joined',
@ -832,7 +833,7 @@ class RoomView extends React.Component {
navToThread = async(item) => {
const { roomUserId } = this.state;
const { navigation } = this.props;
const { navigation, isMasterDetail } = this.props;
if (item.tmid) {
let name = item.tmsg;
@ -843,6 +844,12 @@ class RoomView extends React.Component {
name = I18n.t('Encrypted_message');
}
if (isMasterDetail) {
return navigation.push('RoomView', {
rid: this.rid, tmid: item.tmid, name, t: 'thread', roomUserId, jumpToMessageId: item.id
});
}
return Navigation.reset({
index: 2,
routes: [
@ -883,8 +890,15 @@ class RoomView extends React.Component {
}
navToRoom = async(item) => {
const { navigation, isMasterDetail } = this.props;
const roomInfo = await getRoomInfo(item.rid);
if (isMasterDetail) {
return goRoom({
item: roomInfo, isMasterDetail, navigationMethod: navigation.push, jumpToMessageId: item.id
});
}
return Navigation.reset({
index: 1,
routes: [