Compare commits
13 Commits
develop
...
fix.multip
Author | SHA1 | Date |
---|---|---|
Diego Mello | 2c9fb39365 | |
Reinaldo Neto | 6dca095d44 | |
Reinaldo Neto | 16bb5e468f | |
Reinaldo Neto | 8812d6ff2c | |
Reinaldo Neto | 986abe9a61 | |
Reinaldo Neto | df09ef1c35 | |
Gerzon Z | 20ebc34b20 | |
Gerzon Z | f9662036fd | |
Gerzon Z | f47a1a922c | |
Gerzon Z | daf7a3e02a | |
Gerzon Z | 0d2f55bfd7 | |
Gerzon Z | 1c0533a51e | |
Gerzon Z | 3519282a03 |
|
@ -16,10 +16,15 @@ function replace(name, params) {
|
||||||
navigationRef.current?.dispatch(StackActions.replace(name, params));
|
navigationRef.current?.dispatch(StackActions.replace(name, params));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function reset({ index, routes }) {
|
||||||
|
navigationRef.current?.dispatch(CommonActions.reset({ index, routes }));
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
navigationRef,
|
navigationRef,
|
||||||
routeNameRef,
|
routeNameRef,
|
||||||
navigate,
|
navigate,
|
||||||
back,
|
back,
|
||||||
replace
|
replace,
|
||||||
|
reset
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
|
import { CommonActions } from '@react-navigation/native';
|
||||||
import { Text, View, InteractionManager } from 'react-native';
|
import { Text, View, InteractionManager } from 'react-native';
|
||||||
import { connect } from 'react-redux';
|
import { connect } from 'react-redux';
|
||||||
import parse from 'url-parse';
|
import parse from 'url-parse';
|
||||||
|
@ -57,7 +58,6 @@ import RoomClass from '../../lib/methods/subscriptions/room';
|
||||||
import { getUserSelector } from '../../selectors/login';
|
import { getUserSelector } from '../../selectors/login';
|
||||||
import { CONTAINER_TYPES } from '../../lib/methods/actions';
|
import { CONTAINER_TYPES } from '../../lib/methods/actions';
|
||||||
import Banner from './Banner';
|
import Banner from './Banner';
|
||||||
import Navigation from '../../lib/Navigation';
|
|
||||||
import SafeAreaView from '../../containers/SafeAreaView';
|
import SafeAreaView from '../../containers/SafeAreaView';
|
||||||
import { withDimensions } from '../../dimensions';
|
import { withDimensions } from '../../dimensions';
|
||||||
import { getHeaderTitlePosition } from '../../containers/Header';
|
import { getHeaderTitlePosition } from '../../containers/Header';
|
||||||
|
@ -736,9 +736,10 @@ class RoomView extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
handleRoomRemoved = ({ rid }) => {
|
handleRoomRemoved = ({ rid }) => {
|
||||||
|
const { navigation } = this.props;
|
||||||
const { room } = this.state;
|
const { room } = this.state;
|
||||||
if (rid === this.rid) {
|
if (rid === this.rid) {
|
||||||
Navigation.navigate('RoomsListView');
|
navigation.navigate('RoomsListView');
|
||||||
showErrorAlert(I18n.t('You_were_removed_from_channel', { channel: RocketChat.getRoomTitle(room) }), I18n.t('Oops'));
|
showErrorAlert(I18n.t('You_were_removed_from_channel', { channel: RocketChat.getRoomTitle(room) }), I18n.t('Oops'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -833,7 +834,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,9 +844,45 @@ class RoomView extends React.Component {
|
||||||
if (item.t === E2E_MESSAGE_TYPE && item.e2e !== E2E_STATUS.DONE) {
|
if (item.t === E2E_MESSAGE_TYPE && item.e2e !== E2E_STATUS.DONE) {
|
||||||
name = I18n.t('Encrypted_message');
|
name = I18n.t('Encrypted_message');
|
||||||
}
|
}
|
||||||
return navigation.push('RoomView', {
|
|
||||||
rid: this.rid, tmid: item.tmid, name, t: 'thread', roomUserId, jumpToMessageId: item.id
|
if (isMasterDetail) {
|
||||||
});
|
return navigation.push('RoomView', {
|
||||||
|
rid: this.rid, tmid: item.tmid, name, t: 'thread', roomUserId, jumpToMessageId: item.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return navigation.dispatch(
|
||||||
|
CommonActions.reset({
|
||||||
|
index: 2,
|
||||||
|
routes: [
|
||||||
|
{
|
||||||
|
name: 'RoomsListView'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'RoomView',
|
||||||
|
params: {
|
||||||
|
rid: this.rid,
|
||||||
|
name: item.name,
|
||||||
|
t: item.t,
|
||||||
|
prid: item.prid,
|
||||||
|
room: item,
|
||||||
|
visitor: item.visitor,
|
||||||
|
roomUserId
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'RoomView',
|
||||||
|
params: {
|
||||||
|
rid: this.rid,
|
||||||
|
tmid: item.tmid,
|
||||||
|
name,
|
||||||
|
t: 'thread',
|
||||||
|
roomUserId,
|
||||||
|
jumpToMessageId: item.id
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.tlm) {
|
if (item.tlm) {
|
||||||
|
@ -855,12 +892,38 @@ class RoomView extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
navToRoom = async(message) => {
|
navToRoom = async(item) => {
|
||||||
const { navigation, isMasterDetail } = this.props;
|
const { navigation, isMasterDetail } = this.props;
|
||||||
const roomInfo = await getRoomInfo(message.rid);
|
const roomInfo = await getRoomInfo(item.rid);
|
||||||
return goRoom({
|
|
||||||
item: roomInfo, isMasterDetail, navigationMethod: navigation.push, jumpToMessageId: message.id
|
if (isMasterDetail) {
|
||||||
});
|
return goRoom({
|
||||||
|
item: roomInfo, isMasterDetail, navigationMethod: navigation.push, jumpToMessageId: item.id
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return navigation.dispatch(
|
||||||
|
CommonActions.reset({
|
||||||
|
index: 1,
|
||||||
|
routes: [
|
||||||
|
{
|
||||||
|
name: 'RoomsListView'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'RoomView',
|
||||||
|
params: {
|
||||||
|
rid: roomInfo.rid,
|
||||||
|
name: RocketChat.getRoomTitle(roomInfo),
|
||||||
|
t: roomInfo.t,
|
||||||
|
prid: roomInfo.prid,
|
||||||
|
room: roomInfo,
|
||||||
|
visitor: roomInfo.visitor,
|
||||||
|
roomUserId: RocketChat.getUidDirectMessage(roomInfo),
|
||||||
|
jumpToMessageId: item.id
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
})
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
callJitsi = () => {
|
callJitsi = () => {
|
||||||
|
|
Loading…
Reference in New Issue