From 0fe738315485e49f4407c602e850fece4a1028da Mon Sep 17 00:00:00 2001 From: Calinteodor Date: Tue, 10 May 2022 18:28:23 +0300 Subject: [PATCH] fix(chat/native) private message replies (#11521) Fixes issue #11516 --- react/features/chat/components/native/Chat.js | 8 -------- .../chat/components/native/PrivateMessageButton.js | 7 ++++--- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/react/features/chat/components/native/Chat.js b/react/features/chat/components/native/Chat.js index 20d700852..ef7d71a07 100644 --- a/react/features/chat/components/native/Chat.js +++ b/react/features/chat/components/native/Chat.js @@ -6,7 +6,6 @@ import React, { useEffect } from 'react'; import { translate } from '../../../base/i18n'; import JitsiScreen from '../../../base/modal/components/JitsiScreen'; import { connect } from '../../../base/redux'; -import { closeChat, openChat } from '../../actions.native'; import AbstractChat, { _mapStateToProps, type Props as AbstractProps @@ -69,26 +68,19 @@ class Chat extends AbstractChat { export default translate(connect(_mapStateToProps)(props => { const { _nbUnreadMessages, - dispatch, navigation, - route, t } = props; const isChatScreenFocused = useIsFocused(); - const privateMessageRecipient = route.params?.privateMessageRecipient; const nrUnreadMessages = !isChatScreenFocused && _nbUnreadMessages > 0 ? `(${_nbUnreadMessages})` : ''; useEffect(() => { - dispatch(openChat(privateMessageRecipient)); - navigation.setOptions({ tabBarLabel: `${t('chat.tabs.chat')} ${nrUnreadMessages}` }); - - return () => dispatch(closeChat()); }, [ nrUnreadMessages ]); return ( diff --git a/react/features/chat/components/native/PrivateMessageButton.js b/react/features/chat/components/native/PrivateMessageButton.js index 044a87c3a..b639fbf26 100644 --- a/react/features/chat/components/native/PrivateMessageButton.js +++ b/react/features/chat/components/native/PrivateMessageButton.js @@ -58,7 +58,7 @@ class PrivateMessageButton extends AbstractButton { toggledIcon = IconReply; /** - * Handles clicking / pressing the button, and kicks the participant. + * Handles clicking / pressing the button. * * @private * @returns {void} @@ -67,6 +67,7 @@ class PrivateMessageButton extends AbstractButton { if (this.props._isLobbyMessage) { this.props.dispatch(handleLobbyChatInitialized(this.props.participantID)); } + this.props._isPollsDisabled ? navigate(screen.conference.chat, { privateMessageRecipient: this.props._participant @@ -102,11 +103,11 @@ class PrivateMessageButton extends AbstractButton { export function _mapStateToProps(state: Object, ownProps: Props): $Shape { const enabled = getFeatureFlag(state, CHAT_ENABLED, true); const { disablePolls } = state['features/base/config']; - const { visible = enabled, isLobbyMessage } = ownProps; + const { visible = enabled, isLobbyMessage, participantID } = ownProps; return { _isPollsDisabled: disablePolls, - _participant: getParticipantById(state, ownProps.participantID), + _participant: getParticipantById(state, participantID), _isLobbyMessage: isLobbyMessage, visible };