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

View File

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

View File

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