Fix navToRoomInfo

This commit is contained in:
Gerzon Z 2021-09-02 17:04:39 -04:00
parent cc404b1d78
commit 330ab40e16
3 changed files with 7 additions and 5 deletions

View File

@ -30,6 +30,7 @@ const DiscussionMessagesView = ({ navigation, route }) => {
const canAutoTranslate = route.params?.canAutoTranslate;
const autoTranslate = route.params?.autoTranslate;
const autoTranslateLanguage = route.params?.autoTranslateLanguage;
const navToRoomInfo = route.params?.navToRoomInfo;
const user = useSelector(state => state.login?.user);
const baseUrl = useSelector(state => state.server.server);
const useRealName = useSelector(state => state.settings.UI_Use_Real_Name);
@ -164,7 +165,7 @@ const DiscussionMessagesView = ({ navigation, route }) => {
item={item}
user={user}
rid={rid}
navToRoomInfo={() => {}}
navToRoomInfo={navToRoomInfo}
onDiscussionPress={onDiscussionPress}
baseUrl={baseUrl}
timeFormat={Message_TimeFormat}
@ -173,7 +174,6 @@ const DiscussionMessagesView = ({ navigation, route }) => {
autoTranslateLanguage={autoTranslateLanguage}
/>
);
if (!discussions?.length) {
return (
<>

View File

@ -78,6 +78,7 @@ class RoomActionsView extends React.Component {
const member = props.route.params?.member;
this.rid = props.route.params?.rid;
this.t = props.route.params?.t;
this.navToRoomInfo = props.route.params?.navToRoomInfo;
this.state = {
room: room || { rid: this.rid, t: this.t },
membersCount: 0,
@ -987,7 +988,8 @@ class RoomActionsView extends React.Component {
prid,
canAutoTranslate,
autoTranslate: room.autoTranslate,
autoTranslateLanguage: room.autoTranslateLanguage
autoTranslateLanguage: room.autoTranslateLanguage,
navToRoomInfo: navParam => this.navToRoomInfo(navParam)
}
})}
testID='room-actions-discussions'

View File

@ -420,12 +420,12 @@ class RoomView extends React.Component {
navigation.navigate('ModalStackNavigator', {
screen: screen ?? 'RoomActionsView',
params: {
rid: this.rid, t: this.t, room, member, showCloseModal: !!screen
rid: this.rid, t: this.t, room, member, showCloseModal: !!screen, navToRoomInfo: navParam => this.navToRoomInfo(navParam)
}
});
} else {
navigation.push('RoomActionsView', {
rid: this.rid, t: this.t, room, member
rid: this.rid, t: this.t, room, member, navToRoomInfo: navParam => this.navToRoomInfo(navParam)
});
}
}