Browse Source

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

Fixes issue #11516
master
Calinteodor 3 years ago
parent
commit
0fe7383154
No account linked to committer's email address

+ 0
- 8
react/features/chat/components/native/Chat.js View File

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

+ 4
- 3
react/features/chat/components/native/PrivateMessageButton.js View File

@@ -58,7 +58,7 @@ class PrivateMessageButton extends AbstractButton<Props, any> {
58 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 63
      * @private
64 64
      * @returns {void}
@@ -67,6 +67,7 @@ class PrivateMessageButton extends AbstractButton<Props, any> {
67 67
         if (this.props._isLobbyMessage) {
68 68
             this.props.dispatch(handleLobbyChatInitialized(this.props.participantID));
69 69
         }
70
+
70 71
         this.props._isPollsDisabled
71 72
             ? navigate(screen.conference.chat, {
72 73
                 privateMessageRecipient: this.props._participant
@@ -102,11 +103,11 @@ class PrivateMessageButton extends AbstractButton<Props, any> {
102 103
 export function _mapStateToProps(state: Object, ownProps: Props): $Shape<Props> {
103 104
     const enabled = getFeatureFlag(state, CHAT_ENABLED, true);
104 105
     const { disablePolls } = state['features/base/config'];
105
-    const { visible = enabled, isLobbyMessage } = ownProps;
106
+    const { visible = enabled, isLobbyMessage, participantID } = ownProps;
106 107
 
107 108
     return {
108 109
         _isPollsDisabled: disablePolls,
109
-        _participant: getParticipantById(state, ownProps.participantID),
110
+        _participant: getParticipantById(state, participantID),
110 111
         _isLobbyMessage: isLobbyMessage,
111 112
         visible
112 113
     };

Loading…
Cancel
Save