Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(chat) removed unread msgs counter on chat open

Calin Chitu7945f14cee1b
diff --git a/react/features/chat/components/web/ChatCounter.js b/react/features/chat/components/web/ChatCounter.js
index f1c069c2d2..0708e362e2 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<Props> {
render() {
return (
<span className = 'badge-round'>
+
<span>
- { this.props._count || null }
+ {
+ !this.props._isOpen
+ && (this.props._count || null)
+ }
</span>
</span>
);
@@ -52,8 +61,11 @@ class ChatCounter extends Component<Props> {
* }}
*/
function _mapStateToProps(state) {
+ const { isOpen } = state['features/chat'];
+
return {
- _count: getUnreadCount(state)
+ _count: getUnreadCount(state),
+ _isOpen: isOpen
};
}