Quellcode durchsuchen

fix(chat/native) private message replies (#11521)

Fixes issue #11516
master
Calinteodor vor 3 Jahren
Ursprung
Commit
0fe7383154
Es ist kein Account mit der E-Mail-Adresse des Committers verbunden

+ 0
- 8
react/features/chat/components/native/Chat.js Datei anzeigen

6
 import { translate } from '../../../base/i18n';
6
 import { translate } from '../../../base/i18n';
7
 import JitsiScreen from '../../../base/modal/components/JitsiScreen';
7
 import JitsiScreen from '../../../base/modal/components/JitsiScreen';
8
 import { connect } from '../../../base/redux';
8
 import { connect } from '../../../base/redux';
9
-import { closeChat, openChat } from '../../actions.native';
10
 import AbstractChat, {
9
 import AbstractChat, {
11
     _mapStateToProps,
10
     _mapStateToProps,
12
     type Props as AbstractProps
11
     type Props as AbstractProps
69
 export default translate(connect(_mapStateToProps)(props => {
68
 export default translate(connect(_mapStateToProps)(props => {
70
     const {
69
     const {
71
         _nbUnreadMessages,
70
         _nbUnreadMessages,
72
-        dispatch,
73
         navigation,
71
         navigation,
74
-        route,
75
         t
72
         t
76
     } = props;
73
     } = props;
77
     const isChatScreenFocused = useIsFocused();
74
     const isChatScreenFocused = useIsFocused();
78
-    const privateMessageRecipient = route.params?.privateMessageRecipient;
79
 
75
 
80
     const nrUnreadMessages
76
     const nrUnreadMessages
81
         = !isChatScreenFocused && _nbUnreadMessages > 0
77
         = !isChatScreenFocused && _nbUnreadMessages > 0
82
             ? `(${_nbUnreadMessages})` : '';
78
             ? `(${_nbUnreadMessages})` : '';
83
 
79
 
84
     useEffect(() => {
80
     useEffect(() => {
85
-        dispatch(openChat(privateMessageRecipient));
86
-
87
         navigation.setOptions({
81
         navigation.setOptions({
88
             tabBarLabel: `${t('chat.tabs.chat')} ${nrUnreadMessages}`
82
             tabBarLabel: `${t('chat.tabs.chat')} ${nrUnreadMessages}`
89
         });
83
         });
90
-
91
-        return () => dispatch(closeChat());
92
     }, [ nrUnreadMessages ]);
84
     }, [ nrUnreadMessages ]);
93
 
85
 
94
     return (
86
     return (

+ 4
- 3
react/features/chat/components/native/PrivateMessageButton.js Datei anzeigen

58
     toggledIcon = IconReply;
58
     toggledIcon = IconReply;
59
 
59
 
60
     /**
60
     /**
61
-     * Handles clicking / pressing the button, and kicks the participant.
61
+     * Handles clicking / pressing the button.
62
      *
62
      *
63
      * @private
63
      * @private
64
      * @returns {void}
64
      * @returns {void}
67
         if (this.props._isLobbyMessage) {
67
         if (this.props._isLobbyMessage) {
68
             this.props.dispatch(handleLobbyChatInitialized(this.props.participantID));
68
             this.props.dispatch(handleLobbyChatInitialized(this.props.participantID));
69
         }
69
         }
70
+
70
         this.props._isPollsDisabled
71
         this.props._isPollsDisabled
71
             ? navigate(screen.conference.chat, {
72
             ? navigate(screen.conference.chat, {
72
                 privateMessageRecipient: this.props._participant
73
                 privateMessageRecipient: this.props._participant
102
 export function _mapStateToProps(state: Object, ownProps: Props): $Shape<Props> {
103
 export function _mapStateToProps(state: Object, ownProps: Props): $Shape<Props> {
103
     const enabled = getFeatureFlag(state, CHAT_ENABLED, true);
104
     const enabled = getFeatureFlag(state, CHAT_ENABLED, true);
104
     const { disablePolls } = state['features/base/config'];
105
     const { disablePolls } = state['features/base/config'];
105
-    const { visible = enabled, isLobbyMessage } = ownProps;
106
+    const { visible = enabled, isLobbyMessage, participantID } = ownProps;
106
 
107
 
107
     return {
108
     return {
108
         _isPollsDisabled: disablePolls,
109
         _isPollsDisabled: disablePolls,
109
-        _participant: getParticipantById(state, ownProps.participantID),
110
+        _participant: getParticipantById(state, participantID),
110
         _isLobbyMessage: isLobbyMessage,
111
         _isLobbyMessage: isLobbyMessage,
111
         visible
112
         visible
112
     };
113
     };

Laden…
Abbrechen
Speichern