diff --git a/src/actions/push-notifications/registerer.ts b/src/actions/push-notifications/registerer.ts index b26054ef9..5cb82eefe 100644 --- a/src/actions/push-notifications/registerer.ts +++ b/src/actions/push-notifications/registerer.ts @@ -94,21 +94,15 @@ const register = () => return subscription; } else { // Something went wrong, try to subscribe again - return unsubscribe({ registration, subscription }).then((registration) => { - return subscribe(registration, getState); - }).then(async (pushSubscription) => { - const subscription = await dispatch(sendSubscriptionToBackend(pushSubscription, me)); - return subscription; - }); + return unsubscribe({ registration, subscription }) + .then((registration) => subscribe(registration, getState)) + .then((pushSubscription) => dispatch(sendSubscriptionToBackend(pushSubscription, me))); } } // No subscription, try to subscribe return subscribe(registration, getState) - .then(async (pushSubscription) => { - const subscription = await dispatch(sendSubscriptionToBackend(pushSubscription, me)); - return subscription; - }); + .then((pushSubscription) => dispatch(sendSubscriptionToBackend(pushSubscription, me))); }) .then((subscription) => { // If we got a PushSubscription (and not a subscription object from the backend) diff --git a/src/normalizers/notification.ts b/src/normalizers/notification.ts index 717d3b44f..236e54d92 100644 --- a/src/normalizers/notification.ts +++ b/src/normalizers/notification.ts @@ -34,11 +34,8 @@ const normalizeNotifications = (notifications: Array) => { ); if (existingNotification) { - if (existingNotification?.accounts) { - existingNotification.accounts.push(normalizeAccount(notification.account)); - } else { - existingNotification.accounts = [existingNotification.account, normalizeAccount(notification.account)]; - } + existingNotification.accounts.push(normalizeAccount(notification.account)); + existingNotification.account_ids.push(notification.account.id); existingNotification.id += '+' + notification.id; } else { deduplicatedNotifications.push(normalizeNotification(notification));