From 0c713c1ff59be65da478dcc1929ec6343712da11 Mon Sep 17 00:00:00 2001 From: Mustafa Buyukcelebi Date: Tue, 27 Aug 2019 01:30:09 +0300 Subject: [PATCH] Added a workaround solution for notification issue --- .../application/container/applicationContainer.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/screens/application/container/applicationContainer.js b/src/screens/application/container/applicationContainer.js index 27a95f753..4090008af 100644 --- a/src/screens/application/container/applicationContainer.js +++ b/src/screens/application/container/applicationContainer.js @@ -61,6 +61,7 @@ import { isPinCodeOpen, setPinCode as savePinCode, } from '../../../redux/actions/applicationActions'; +import { updateActiveBottomTab } from '../../../redux/actions/uiAction'; import { encryptKey } from '../../../utils/crypto'; @@ -553,12 +554,18 @@ class ApplicationContainer extends Component { }; _connectNotificationServer = username => { - const { dispatch, unreadActivityCount } = this.props; const ws = new WebSocket(`${Config.ACTIVITY_WEBSOCKET_URL}?user=${username}`); ws.onmessage = () => { - // a message was received + const { activeBottomTab, unreadActivityCount, dispatch } = this.props; + dispatch(updateUnreadActivityCount(unreadActivityCount + 1)); + + // Workaround + if (activeBottomTab === ROUTES.TABBAR.NOTIFICATION) { + dispatch(updateActiveBottomTab('')); + dispatch(updateActiveBottomTab(ROUTES.TABBAR.NOTIFICATION)); + } }; }; @@ -677,6 +684,7 @@ export default connect( // UI toastNotification: state.ui.toastNotification, + activeBottomTab: state.ui.activeBottomTab, }), dispatch => ({ dispatch,