|
@@ -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
|
|