Minor tweak
This commit is contained in:
parent
f47a1a922c
commit
f9662036fd
|
@ -69,6 +69,7 @@ import LoadMore from './LoadMore';
|
||||||
import RoomServices from './services';
|
import RoomServices from './services';
|
||||||
import getThreadName from '../../lib/methods/getThreadName';
|
import getThreadName from '../../lib/methods/getThreadName';
|
||||||
import getRoomInfo from '../../lib/methods/getRoomInfo';
|
import getRoomInfo from '../../lib/methods/getRoomInfo';
|
||||||
|
import { goRoom } from '../../utils/goRoom';
|
||||||
|
|
||||||
const stateAttrsUpdate = [
|
const stateAttrsUpdate = [
|
||||||
'joined',
|
'joined',
|
||||||
|
@ -832,7 +833,7 @@ class RoomView extends React.Component {
|
||||||
|
|
||||||
navToThread = async(item) => {
|
navToThread = async(item) => {
|
||||||
const { roomUserId } = this.state;
|
const { roomUserId } = this.state;
|
||||||
const { navigation } = this.props;
|
const { navigation, isMasterDetail } = this.props;
|
||||||
|
|
||||||
if (item.tmid) {
|
if (item.tmid) {
|
||||||
let name = item.tmsg;
|
let name = item.tmsg;
|
||||||
|
@ -843,6 +844,12 @@ class RoomView extends React.Component {
|
||||||
name = I18n.t('Encrypted_message');
|
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({
|
return Navigation.reset({
|
||||||
index: 2,
|
index: 2,
|
||||||
routes: [
|
routes: [
|
||||||
|
@ -883,8 +890,15 @@ class RoomView extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
navToRoom = async(item) => {
|
navToRoom = async(item) => {
|
||||||
|
const { navigation, isMasterDetail } = this.props;
|
||||||
const roomInfo = await getRoomInfo(item.rid);
|
const roomInfo = await getRoomInfo(item.rid);
|
||||||
|
|
||||||
|
if (isMasterDetail) {
|
||||||
|
return goRoom({
|
||||||
|
item: roomInfo, isMasterDetail, navigationMethod: navigation.push, jumpToMessageId: item.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
return Navigation.reset({
|
return Navigation.reset({
|
||||||
index: 1,
|
index: 1,
|
||||||
routes: [
|
routes: [
|
||||||
|
|
Loading…
Reference in New Issue