summaryrefslogtreecommitdiffstats
path: root/webapp/components/user_settings/desktop_notification_settings.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/components/user_settings/desktop_notification_settings.jsx')
-rw-r--r--webapp/components/user_settings/desktop_notification_settings.jsx83
1 files changed, 41 insertions, 42 deletions
diff --git a/webapp/components/user_settings/desktop_notification_settings.jsx b/webapp/components/user_settings/desktop_notification_settings.jsx
index 79d500c88..abdbff512 100644
--- a/webapp/components/user_settings/desktop_notification_settings.jsx
+++ b/webapp/components/user_settings/desktop_notification_settings.jsx
@@ -5,7 +5,6 @@ import SettingItemMin from 'components/setting_item_min.jsx';
import SettingItemMax from 'components/setting_item_max.jsx';
import * as Utils from 'utils/utils.jsx';
-import * as UserAgent from 'utils/user_agent.jsx';
import PropTypes from 'prop-types';
@@ -45,24 +44,7 @@ export default class DesktopNotificationSettings extends React.Component {
soundRadio[0] = true;
}
- if (UserAgent.isFirefox()) {
- soundSection = (
- <div>
- <hr/>
- <label>
- <FormattedMessage
- id='user.settings.notifications.desktop.sound'
- defaultMessage='Notification sound'
- />
- </label>
- <br/>
- <FormattedMessage
- id='user.settings.notifications.soundConfig'
- defaultMessage='Please configure notification sounds in your browser settings'
- />
- </div>
- );
- } else {
+ if (Utils.hasSoundOptions()) {
soundSection = (
<div>
<hr/>
@@ -109,11 +91,28 @@ export default class DesktopNotificationSettings extends React.Component {
<span>
<FormattedMessage
id='user.settings.notifications.sounds_info'
- defaultMessage='Notification sounds are available on IE11, Edge, Safari, Chrome and Mattermost Desktop Apps.'
+ defaultMessage='Notification sounds are available on IE11, Safari, Chrome and Mattermost Desktop Apps.'
/>
</span>
</div>
);
+ } else {
+ soundSection = (
+ <div>
+ <hr/>
+ <label>
+ <FormattedMessage
+ id='user.settings.notifications.desktop.sound'
+ defaultMessage='Notification sound'
+ />
+ </label>
+ <br/>
+ <FormattedMessage
+ id='user.settings.notifications.soundConfig'
+ defaultMessage='Please configure notification sounds in your browser settings'
+ />
+ </div>
+ );
}
const durationRadio = [false, false, false, false];
@@ -304,26 +303,26 @@ export default class DesktopNotificationSettings extends React.Component {
buildMinimizedSetting() {
let describe = '';
if (this.props.activity === 'mention') {
- if (UserAgent.isFirefox()) {
- if (this.props.duration === '0') {
+ if (Utils.hasSoundOptions() && this.props.sound !== 'false') {
+ if (this.props.duration === '0') { //eslint-disable-line no-lonely-if
describe = (
<FormattedMessage
- id='user.settings.notifications.desktop.mentionsFirefoxForever'
- defaultMessage='For mentions and direct messages, shown indefinitely'
+ id='user.settings.notifications.desktop.mentionsSoundForever'
+ defaultMessage='For mentions and direct messages, with sound, shown indefinitely'
/>
);
} else {
describe = (
<FormattedMessage
- id='user.settings.notifications.desktop.mentionsFirefoxTimed'
- defaultMessage='For mentions and direct messages, shown for {seconds} seconds'
+ id='user.settings.notifications.desktop.mentionsSoundTimed'
+ defaultMessage='For mentions and direct messages, with sound, shown for {seconds} seconds'
values={{
seconds: this.props.duration
}}
/>
);
}
- } else if (this.props.sound === 'false') {
+ } else if (Utils.hasSoundOptions() && this.props.sound === 'false') {
if (this.props.duration === '0') {
describe = (
<FormattedMessage
@@ -346,15 +345,15 @@ export default class DesktopNotificationSettings extends React.Component {
if (this.props.duration === '0') { //eslint-disable-line no-lonely-if
describe = (
<FormattedMessage
- id='user.settings.notifications.desktop.mentionsSoundForever'
- defaultMessage='For mentions and direct messages, with sound, shown indefinitely'
+ id='user.settings.notifications.desktop.mentionsSoundHiddenForever'
+ defaultMessage='For mentions and direct messages, shown indefinitely'
/>
);
} else {
describe = (
<FormattedMessage
- id='user.settings.notifications.desktop.mentionsSoundTimed'
- defaultMessage='For mentions and direct messages, with sound, shown for {seconds} seconds'
+ id='user.settings.notifications.desktop.mentionsSoundHiddenTimed'
+ defaultMessage='For mentions and direct messages, shown for {seconds} seconds'
values={{
seconds: this.props.duration
}}
@@ -370,26 +369,26 @@ export default class DesktopNotificationSettings extends React.Component {
/>
);
} else {
- if (UserAgent.isFirefox()) { //eslint-disable-line no-lonely-if
- if (this.props.duration === '0') {
+ if (Utils.hasSoundOptions() && this.props.sound !== 'false') { //eslint-disable-line no-lonely-if
+ if (this.props.duration === '0') { //eslint-disable-line no-lonely-if
describe = (
<FormattedMessage
- id='user.settings.notifications.desktop.allFirefoxForever'
- defaultMessage='For all activity, shown indefinitely'
+ id='user.settings.notifications.desktop.allSoundForever'
+ defaultMessage='For all activity, with sound, shown indefinitely'
/>
);
} else {
describe = (
<FormattedMessage
- id='user.settings.notifications.desktop.allFirefoxTimed'
- defaultMessage='For all activity, shown for {seconds} seconds'
+ id='user.settings.notifications.desktop.allSoundTimed'
+ defaultMessage='For all activity, with sound, shown for {seconds} seconds'
values={{
seconds: this.props.duration
}}
/>
);
}
- } else if (this.props.sound === 'false') {
+ } else if (Utils.hasSoundOptions() && this.props.sound === 'false') {
if (this.props.duration === '0') {
describe = (
<FormattedMessage
@@ -412,15 +411,15 @@ export default class DesktopNotificationSettings extends React.Component {
if (this.props.duration === '0') { //eslint-disable-line no-lonely-if
describe = (
<FormattedMessage
- id='user.settings.notifications.desktop.allSoundForever'
- defaultMessage='For all activity, with sound, shown indefinitely'
+ id='user.settings.notifications.desktop.allSoundHiddenForever'
+ defaultMessage='For all activity, shown indefinitely'
/>
);
} else {
describe = (
<FormattedMessage
- id='user.settings.notifications.desktop.allSoundTimed'
- defaultMessage='For all activity, with sound, shown for {seconds} seconds'
+ id='user.settings.notifications.desktop.allSoundHiddenTimed'
+ defaultMessage='For all activity, shown for {seconds} seconds'
values={{
seconds: this.props.duration
}}