From af9ea1b5503c503bda247565b41e659d4765d0f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5var=20Aamb=C3=B8=20Fosstveit?= Date: Wed, 31 Oct 2018 12:53:55 +0100 Subject: [PATCH] Added notification sound on new file shared --- app/lib/RoomClient.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/app/lib/RoomClient.js b/app/lib/RoomClient.js index c52fe0b..5524293 100644 --- a/app/lib/RoomClient.js +++ b/app/lib/RoomClient.js @@ -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); + }); + } + } }); }