mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 12:21:31 +03:00
Merge pull request #671 from esteemapp/bugfix/notification
Implemented new notification structure
This commit is contained in:
commit
fef0bab62b
@ -173,22 +173,24 @@ const RootContainer = () => (WrappedComponent) => {
|
|||||||
|
|
||||||
Push.setListener({
|
Push.setListener({
|
||||||
onPushNotificationReceived(pushNotification) {
|
onPushNotificationReceived(pushNotification) {
|
||||||
const extra = JSON.parse(pushNotification.customProperties.extra);
|
const push = pushNotification.customProperties;
|
||||||
|
|
||||||
if (extra.parent_permlink || extra.permlink) {
|
if (push.parent_permlink1 || push.permlink1) {
|
||||||
params = {
|
params = {
|
||||||
author: extra.parent_permlink
|
author: push.parent_permlink1 ? push.parent_author : push.target,
|
||||||
? extra.parent_author
|
permlink: push.parent_permlink1
|
||||||
: pushNotification.customProperties.target,
|
? `${push.parent_permlink1}${push.parent_permlink2}${push.parent_permlink3}`
|
||||||
permlink: extra.parent_permlink ? extra.parent_permlink : extra.permlink,
|
: `${push.permlink1}${push.permlink2}${push.permlink3}`,
|
||||||
};
|
};
|
||||||
key = extra.parent_permlink ? extra.parent_permlink : extra.permlink;
|
key = push.parent_permlink1
|
||||||
|
? `${push.parent_permlink1}${push.parent_permlink2}${push.parent_permlink3}`
|
||||||
|
: `${push.permlink1}${push.permlink2}${push.permlink3}`;
|
||||||
routeName = ROUTES.SCREENS.POST;
|
routeName = ROUTES.SCREENS.POST;
|
||||||
} else {
|
} else {
|
||||||
params = {
|
params = {
|
||||||
username: pushNotification.customProperties.source,
|
username: push.source,
|
||||||
};
|
};
|
||||||
key = pushNotification.customProperties.source;
|
key = push.source;
|
||||||
routeName = ROUTES.SCREENS.PROFILE;
|
routeName = ROUTES.SCREENS.PROFILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user