Merge pull request #7206 from diegobenetti/issue7195-audible-notifications

Fix audible notifications
This commit is contained in:
Anton Georgiev 2019-04-09 14:01:01 -04:00 committed by GitHub
commit 6be7227108
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,4 @@
import React, { PureComponent } from 'react';
import React, { PureComponent, Fragment } from 'react';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import { Session } from 'meteor/session';
@ -117,9 +117,7 @@ class ChatAlert extends PureComponent {
},
);
if (!pushAlertDisabled) {
this.setChatMessagesState(newPendingNotificationsByChat, newLastAlertTimestampByChat);
}
this.setChatMessagesState(newPendingNotificationsByChat, newLastAlertTimestampByChat);
}
setAlertEnabledTimestamp(newAlertEnabledTimestamp) {
@ -178,7 +176,7 @@ class ChatAlert extends PureComponent {
const shouldPlay = Object.keys(pendingNotificationsByChat).length > 0;
return (
<span>
<Fragment>
{!audioAlertDisabled ? <ChatAudioAlert play={shouldPlay} /> : null}
{
!pushAlertDisabled
@ -216,7 +214,7 @@ class ChatAlert extends PureComponent {
})
: null
}
</span>
</Fragment>
);
}
}