瀏覽代碼

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
     /**
13
     /**
14
      * The value of to display as a count.
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
     render() {
38
     render() {
34
         return (
39
         return (
35
             <span className = 'badge-round'>
40
             <span className = 'badge-round'>
41
+
36
                 <span>
42
                 <span>
37
-                    { this.props._count || null }
43
+                    {
44
+                        !this.props._isOpen
45
+                        && (this.props._count || null)
46
+                    }
38
                 </span>
47
                 </span>
39
             </span>
48
             </span>
40
         );
49
         );
52
  * }}
61
  * }}
53
  */
62
  */
54
 function _mapStateToProps(state) {
63
 function _mapStateToProps(state) {
64
+    const { isOpen } = state['features/chat'];
65
+
55
     return {
66
     return {
56
-        _count: getUnreadCount(state)
67
+        _count: getUnreadCount(state),
68
+        _isOpen: isOpen
57
     };
69
     };
58
 }
70
 }
59
 
71
 

Loading…
取消
儲存