瀏覽代碼

fix(chat) removed unread msgs counter on chat open

master
Calin Chitu 3 年之前
父節點
當前提交
7945f14cee
共有 1 個檔案被更改,包括 15 行新增3 行删除
  1. 15
    3
      react/features/chat/components/web/ChatCounter.js

+ 15
- 3
react/features/chat/components/web/ChatCounter.js 查看文件

@@ -13,7 +13,12 @@ type Props = {
13 13
     /**
14 14
      * The value of to display as a count.
15 15
      */
16
-    _count: number
16
+    _count: number,
17
+
18
+    /**
19
+     * True if the chat window should be rendered.
20
+     */
21
+    _isOpen: boolean
17 22
 };
18 23
 
19 24
 /**
@@ -33,8 +38,12 @@ class ChatCounter extends Component<Props> {
33 38
     render() {
34 39
         return (
35 40
             <span className = 'badge-round'>
41
+
36 42
                 <span>
37
-                    { this.props._count || null }
43
+                    {
44
+                        !this.props._isOpen
45
+                        && (this.props._count || null)
46
+                    }
38 47
                 </span>
39 48
             </span>
40 49
         );
@@ -52,8 +61,11 @@ class ChatCounter extends Component<Props> {
52 61
  * }}
53 62
  */
54 63
 function _mapStateToProps(state) {
64
+    const { isOpen } = state['features/chat'];
65
+
55 66
     return {
56
-        _count: getUnreadCount(state)
67
+        _count: getUnreadCount(state),
68
+        _isOpen: isOpen
57 69
     };
58 70
 }
59 71
 

Loading…
取消
儲存