onClose to return true to imply modal should close

This commit is contained in:
tombrown86 2020-07-23 12:56:45 +01:00 committed by Saúl Ibarra Corretgé
parent 4161e7bfe1
commit 63d4c2b84b
1 changed files with 26 additions and 1 deletions

View File

@ -21,6 +21,18 @@ import MessageRecipient from './MessageRecipient';
* the mobile client.
*/
class Chat extends AbstractChat<Props> {
/**
* Instantiates a new instance.
*
* @inheritdoc
*/
constructor(props: Props) {
super(props);
this._onClose = this._onClose.bind(this);
}
/**
* Implements React's {@link Component#render()}.
*
@ -33,7 +45,7 @@ class Chat extends AbstractChat<Props> {
headerLabelKey: 'chat.title'
}}
modalId = { CHAT_VIEW_MODAL_ID }
onClose = { this.props._onToggleChat }>
onClose = { this._onClose }>
<MessageContainer messages = { this.props._messages } />
<MessageRecipient />
@ -41,6 +53,19 @@ class Chat extends AbstractChat<Props> {
</JitsiModal>
);
}
_onClose: () => boolean
/**
* Closes the window.
*
* @returns {boolean}
*/
_onClose() {
this.props._onToggleChat();
return true;
}
}
export default translate(connect(_mapStateToProps, _mapDispatchToProps)(Chat));