From 9c0946eae546aba94ef37dce12ddbcc0718f62ea Mon Sep 17 00:00:00 2001 From: GleidsonDaniel Date: Mon, 18 Mar 2024 17:56:32 -0300 Subject: [PATCH] chore: test ios push --- app/lib/notifications/index.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/app/lib/notifications/index.ts b/app/lib/notifications/index.ts index f477b6474..9a7d2e5e8 100644 --- a/app/lib/notifications/index.ts +++ b/app/lib/notifications/index.ts @@ -19,13 +19,11 @@ 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 && push?.payload?.ejson) { + if (push?.payload?.ejson) { const notification = EJSON.parse(push?.payload?.ejson); store.dispatch(deepLinkingClickCallPush({ ...notification, event: identifier === 'ACCEPT_ACTION' ? 'accept' : 'decline' })); - return; } - } - if (push?.payload) { + } else if (push?.payload) { try { const notification = push?.payload; if (notification.ejson) { @@ -49,13 +47,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;