Fix navToRoomInfo
This commit is contained in:
parent
cc404b1d78
commit
330ab40e16
|
@ -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 (
|
||||||
<>
|
<>
|
||||||
|
|
|
@ -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'
|
||||||
|
|
|
@ -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)
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue