Merge pull request #1345 from esteemapp/notification-read

fix #1254, mark notifications as read when opened from push
This commit is contained in:
Feruz M 2019-12-02 18:44:02 +02:00 committed by GitHub
commit 7e60ee18cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@ import {
} from '../../../realm/realm';
import { getUser, getPost } from '../../../providers/steem/dsteem';
import { switchAccount } from '../../../providers/steem/auth';
import { setPushToken } from '../../../providers/esteem/esteem';
import { setPushToken, markActivityAsRead } from '../../../providers/esteem/esteem';
import { navigate } from '../../../navigation/service';
// Actions
@ -307,6 +307,13 @@ class ApplicationContainer extends Component {
const fullParentPermlink = `${parentPermlink1}${parentPermlink2}${parentPermlink3}`;
const fullPermlink = `${permlink1}${permlink2}${permlink3}`;
const username = get(push, 'target', '');
const activity_id = get(push, 'id', '');
markActivityAsRead(username, activity_id).then(result => {
dispatch(updateUnreadActivityCount(result.unread));
});
switch (type) {
case 'vote':
case 'unvote':