fix #1254, mark notifications as read when opened from push

This commit is contained in:
feruz 2019-12-02 12:05:24 +02:00
parent 19ffd36faa
commit 960491340d

View File

@ -38,7 +38,7 @@ import {
} from '../../../realm/realm'; } from '../../../realm/realm';
import { getUser, getPost } from '../../../providers/steem/dsteem'; import { getUser, getPost } from '../../../providers/steem/dsteem';
import { switchAccount } from '../../../providers/steem/auth'; import { switchAccount } from '../../../providers/steem/auth';
import { setPushToken } from '../../../providers/esteem/esteem'; import { setPushToken, markActivityAsRead } from '../../../providers/esteem/esteem';
import { navigate } from '../../../navigation/service'; import { navigate } from '../../../navigation/service';
// Actions // Actions
@ -307,6 +307,13 @@ class ApplicationContainer extends Component {
const fullParentPermlink = `${parentPermlink1}${parentPermlink2}${parentPermlink3}`; const fullParentPermlink = `${parentPermlink1}${parentPermlink2}${parentPermlink3}`;
const fullPermlink = `${permlink1}${permlink2}${permlink3}`; 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) { switch (type) {
case 'vote': case 'vote':
case 'unvote': case 'unvote':