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