diff --git a/app/src/RoomClient.js b/app/src/RoomClient.js
index 2413838..488ed24 100644
--- a/app/src/RoomClient.js
+++ b/app/src/RoomClient.js
@@ -516,16 +516,21 @@ export default class RoomClient
_soundNotification()
{
- const alertPromise = this._soundAlert.play();
+ const { notificationSounds } = store.getState().settings;
- if (alertPromise !== undefined)
+ if (notificationSounds)
{
- alertPromise
- .then()
- .catch((error) =>
- {
- logger.error('_soundAlert.play() | failed: %o', error);
- });
+ const alertPromise = this._soundAlert.play();
+
+ if (alertPromise !== undefined)
+ {
+ alertPromise
+ .then()
+ .catch((error) =>
+ {
+ logger.error('_soundAlert.play() | failed: %o', error);
+ });
+ }
}
}
@@ -2343,6 +2348,8 @@ export default class RoomClient
store.dispatch(
peerActions.addPeer({ id, displayName, picture, roles, consumers: [] }));
+ this._soundNotification();
+
store.dispatch(requestActions.notify(
{
text : intl.formatMessage({
diff --git a/app/src/actions/settingsActions.js b/app/src/actions/settingsActions.js
index 34c4651..112dd0b 100644
--- a/app/src/actions/settingsActions.js
+++ b/app/src/actions/settingsActions.js
@@ -43,6 +43,11 @@ export const toggleHiddenControls = () =>
type : 'TOGGLE_HIDDEN_CONTROLS'
});
+export const toggleNotificationSounds = () =>
+ ({
+ type : 'TOGGLE_NOTIFICATION_SOUNDS'
+ });
+
export const setLastN = (lastN) =>
({
type : 'SET_LAST_N',
diff --git a/app/src/components/Settings/AdvancedSettings.js b/app/src/components/Settings/AdvancedSettings.js
index 131395e..520dc0f 100644
--- a/app/src/components/Settings/AdvancedSettings.js
+++ b/app/src/components/Settings/AdvancedSettings.js
@@ -28,6 +28,7 @@ const AdvancedSettings = ({
roomClient,
settings,
onToggleAdvancedMode,
+ onToggleNotificationSounds,
classes
}) =>
{
@@ -43,6 +44,14 @@ const AdvancedSettings = ({
defaultMessage : 'Advanced mode'
})}
/>
+