mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-20 03:42:10 +03:00
Merge pull request #1091 from esteemapp/hotfix/notification
Added a workaround solution for notification issue
This commit is contained in:
commit
4536cdcb93
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user