fix(chat) removed unread msgs counter on chat open
This commit is contained in:
parent
35c7f156db
commit
7945f14cee
|
@ -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
|
||||
};
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue