From 6042d305ac3915de6c50ec2623074a302e9c856c Mon Sep 17 00:00:00 2001 From: Torjus Date: Mon, 30 Jul 2018 15:05:20 +0200 Subject: [PATCH] Fix badge logic and add notification when receiving files --- app/lib/RoomClient.js | 8 ++++++-- app/lib/redux/reducers/toolarea.js | 3 ++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/app/lib/RoomClient.js b/app/lib/RoomClient.js index d537f7e..c15bee4 100644 --- a/app/lib/RoomClient.js +++ b/app/lib/RoomClient.js @@ -1166,9 +1166,13 @@ export default class RoomClient { accept(); - const { file } = request.data; + const payload = request.data.file; - this._dispatch(stateActions.addFile(file)); + this._dispatch(stateActions.addFile(payload)); + + this._dispatch(requestActions.notify({ + text: `${payload.name} shared a file` + })); break; } diff --git a/app/lib/redux/reducers/toolarea.js b/app/lib/redux/reducers/toolarea.js index fa5b0df..0d25eca 100644 --- a/app/lib/redux/reducers/toolarea.js +++ b/app/lib/redux/reducers/toolarea.js @@ -14,8 +14,9 @@ const toolarea = (state = initialState, action) => { const toolAreaOpen = !state.toolAreaOpen; const unreadMessages = toolAreaOpen && state.currentToolTab === 'chat' ? 0 : state.unreadMessages; + const unreadFiles = toolAreaOpen && state.currentToolTab === 'files' ? 0 : state.unreadFiles; - return { ...state, toolAreaOpen, unreadMessages }; + return { ...state, toolAreaOpen, unreadMessages, unreadFiles }; } case 'SET_TOOL_TAB':