fix(chat/native) we need to dispatch close and open chat

This commit is contained in:
Calin Chitu 2022-05-13 17:46:50 +03:00
parent 8deebebe47
commit 44319b377d
2 changed files with 7 additions and 1 deletions

View File

@ -6,6 +6,7 @@ import React, { useEffect } from 'react';
import { translate } from '../../../base/i18n';
import JitsiScreen from '../../../base/modal/components/JitsiScreen';
import { connect } from '../../../base/redux';
import { closeChat } from '../../actions.any';
import AbstractChat, {
_mapStateToProps,
type Props as AbstractProps
@ -81,6 +82,8 @@ export default translate(connect(_mapStateToProps)(props => {
navigation.setOptions({
tabBarLabel: `${t('chat.tabs.chat')} ${nrUnreadMessages}`
});
return () => props.dispatch(closeChat());
}, [ nrUnreadMessages ]);
return (

View File

@ -6,10 +6,11 @@ import { IconMessage, IconReply } from '../../../base/icons';
import { getParticipantById } from '../../../base/participants';
import { connect } from '../../../base/redux';
import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
import { handleLobbyChatInitialized } from '../../../chat/actions.any';
import { handleLobbyChatInitialized, openChat } from '../../../chat/actions';
import { navigate } from '../../../mobile/navigation/components/conference/ConferenceNavigationContainerRef';
import { screen } from '../../../mobile/navigation/routes';
export type Props = AbstractButtonProps & {
/**
@ -68,6 +69,8 @@ class PrivateMessageButton extends AbstractButton<Props, any> {
this.props.dispatch(handleLobbyChatInitialized(this.props.participantID));
}
this.props.dispatch(openChat(this.props._participant));
this.props._isPollsDisabled
? navigate(screen.conference.chat, {
privateMessageRecipient: this.props._participant