Compare commits
6 Commits
develop
...
fix.switch
Author | SHA1 | Date |
---|---|---|
Diego Mello | e9dff0be24 | |
Reinaldo Neto | 81e7685cd1 | |
Reinaldo Neto | 9fe4666d50 | |
Reinaldo Neto | a352dc926d | |
Reinaldo Neto | 3d1c594efc | |
Reinaldo Neto | ece46fe7b8 |
|
@ -16,10 +16,15 @@ function replace(name, params) {
|
|||
navigationRef.current?.dispatch(StackActions.replace(name, params));
|
||||
}
|
||||
|
||||
function reset({ index, routes }) {
|
||||
navigationRef.current?.dispatch(CommonActions.reset({ index, routes }));
|
||||
}
|
||||
|
||||
export default {
|
||||
navigationRef,
|
||||
routeNameRef,
|
||||
navigate,
|
||||
back,
|
||||
replace
|
||||
replace,
|
||||
reset
|
||||
};
|
||||
|
|
|
@ -2,10 +2,35 @@ import Navigation from '../lib/Navigation';
|
|||
import RocketChat from '../lib/rocketchat';
|
||||
|
||||
const navigate = ({ item, isMasterDetail, ...props }) => {
|
||||
let navigationMethod = props.navigationMethod ?? Navigation.navigate;
|
||||
const navigationMethod = props.navigationMethod ?? Navigation.navigate;
|
||||
|
||||
if (isMasterDetail) {
|
||||
navigationMethod = Navigation.replace;
|
||||
return Navigation.reset({
|
||||
index: 0,
|
||||
routes: [
|
||||
{
|
||||
name: 'ChatsStackNavigator',
|
||||
state: {
|
||||
routes: [
|
||||
{
|
||||
name: 'RoomView',
|
||||
params: {
|
||||
rid: item.rid,
|
||||
name: RocketChat.getRoomTitle(item),
|
||||
t: item.t,
|
||||
prid: item.prid,
|
||||
room: item,
|
||||
visitor: item.visitor,
|
||||
roomUserId: RocketChat.getUidDirectMessage(item),
|
||||
...props
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
navigationMethod('RoomView', {
|
||||
|
|
|
@ -726,8 +726,7 @@ class RoomsListView extends React.Component {
|
|||
goRoom = ({ item, isMasterDetail }) => {
|
||||
logEvent(events.RL_GO_ROOM);
|
||||
const { item: currentItem } = this.state;
|
||||
const { rooms } = this.props;
|
||||
if (currentItem?.rid === item.rid || rooms?.includes(item.rid)) {
|
||||
if (currentItem?.rid === item.rid) {
|
||||
return;
|
||||
}
|
||||
// Only mark room as focused when in master detail layout
|
||||
|
|
Loading…
Reference in New Issue