From 7945f14cee1b855c72c3bc2572d7018b07a0403e Mon Sep 17 00:00:00 2001 From: Calin Chitu Date: Thu, 24 Jun 2021 12:29:51 +0300 Subject: [PATCH] fix(chat) removed unread msgs counter on chat open --- .../chat/components/web/ChatCounter.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/react/features/chat/components/web/ChatCounter.js b/react/features/chat/components/web/ChatCounter.js index f1c069c2d..0708e362e 100644 --- a/react/features/chat/components/web/ChatCounter.js +++ b/react/features/chat/components/web/ChatCounter.js @@ -13,7 +13,12 @@ type Props = { /** * The value of to display as a count. */ - _count: number + _count: number, + + /** + * True if the chat window should be rendered. + */ + _isOpen: boolean }; /** @@ -33,8 +38,12 @@ class ChatCounter extends Component { render() { return ( + - { this.props._count || null } + { + !this.props._isOpen + && (this.props._count || null) + } ); @@ -52,8 +61,11 @@ class ChatCounter extends Component { * }} */ function _mapStateToProps(state) { + const { isOpen } = state['features/chat']; + return { - _count: getUnreadCount(state) + _count: getUnreadCount(state), + _isOpen: isOpen }; }