Merge pull request #1090 from esteemapp/bugfix/notf-unread

changed seting unread count dispatch func
This commit is contained in:
Mustafa Buyukcelebi 2019-08-27 01:45:11 +03:00 committed by GitHub
commit 7d045d2b89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -124,9 +124,9 @@ class NotificationContainer extends Component {
this.setState({ isNotificationRefreshing: true });
markActivityAsRead(username)
.then(result => {
dispatch(updateUnreadActivityCount(result.unread));
.then(() => {
const updatedNotifications = notifications.map(item => ({ ...item, read: 1 }));
dispatch(updateUnreadActivityCount(0));
this.setState({ notifications: updatedNotifications, isNotificationRefreshing: false });
})
.catch(() => {