Added notification sound on new file shared

master
Håvar Aambø Fosstveit 2018-10-31 12:53:55 +01:00
parent e38d5c55f4
commit af9ea1b550
1 changed files with 17 additions and 0 deletions

View File

@ -1141,6 +1141,23 @@ export default class RoomClient
this._dispatch(stateActions.addFile(payload));
this.notify(`${payload.name} shared a file`);
if (!this._getState().toolarea.toolAreaOpen ||
(this._getState().toolarea.toolAreaOpen &&
this._getState().toolarea.currentToolTab !== 'files')) // Make sound
{
const alertPromise = this._soundAlert.play();
if (alertPromise !== undefined)
{
alertPromise
.then()
.catch((error) =>
{
logger.error('_soundAlert.play() | failed: %o', error);
});
}
}
});
}