From 2c36011a595bc23f96da69be2964e7b2ac3b5062 Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Tue, 19 Mar 2024 08:46:54 -0300 Subject: [PATCH] revert notifications --- app/lib/notifications/index.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/lib/notifications/index.ts b/app/lib/notifications/index.ts index 9a7d2e5e8..f477b6474 100644 --- a/app/lib/notifications/index.ts +++ b/app/lib/notifications/index.ts @@ -19,11 +19,13 @@ interface IEjson { export const onNotification = (push: INotification): void => { const identifier = String(push?.payload?.action?.identifier); if (identifier === 'ACCEPT_ACTION' || identifier === 'DECLINE_ACTION') { - if (push?.payload?.ejson) { + if (push?.payload && push?.payload?.ejson) { const notification = EJSON.parse(push?.payload?.ejson); store.dispatch(deepLinkingClickCallPush({ ...notification, event: identifier === 'ACCEPT_ACTION' ? 'accept' : 'decline' })); + return; } - } else if (push?.payload) { + } + if (push?.payload) { try { const notification = push?.payload; if (notification.ejson) { @@ -47,13 +49,13 @@ export const onNotification = (push: INotification): void => { path: `${types[type]}/${roomName}` }; store.dispatch(deepLinkingOpen(params)); + return; } } catch (e) { console.warn(e); } - } else { - store.dispatch(appInit()); } + store.dispatch(appInit()); }; export const getDeviceToken = (): string => deviceToken;