From f936749760d10531113dcb7b34430466f13717e3 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Fri, 20 Feb 2026 11:01:57 +0200 Subject: [PATCH] fix rebase error --- src/Navigation.tsx | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/Navigation.tsx b/src/Navigation.tsx index b3e75c93af..61784bdae2 100644 --- a/src/Navigation.tsx +++ b/src/Navigation.tsx @@ -887,6 +887,11 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) { const emailDialogControl = useEmailDialogControl() const closeAllActiveElements = useCloseAllActiveElements() const linkingUrl = Linking.useLinkingURL() + const [initialNotificationResponse, setInitialNotificationResponse] = + useState(() => { + if (!IS_NATIVE) return null + return Notifications.getLastNotificationResponse() + }) const [initialState] = useState(() => { if (!IS_NATIVE) return @@ -904,7 +909,7 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) { // - no intent // - not handling a notification if (linkingUrl) return - if (notificationResponse) return + if (initialNotificationResponse) return if (previousNavState.did !== currentAccount?.did) { return } @@ -960,15 +965,14 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) { // intent urls are handled by `useIntentHandler` if (linkingUrl) return - const notificationResponse = Notifications.getLastNotificationResponse() - - if (notificationResponse) { + if (initialNotificationResponse) { notyLogger.debug(`handlePushNotificationEntry: response`, { - response: notificationResponse, + response: initialNotificationResponse, }) // Clear the last notification response to ensure it's not used again try { + setInitialNotificationResponse(null) Notifications.clearLastNotificationResponse() } catch (error) { notyLogger.error( @@ -977,7 +981,9 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) { ) } - const payload = getNotificationPayload(notificationResponse.notification) + const payload = getNotificationPayload( + initialNotificationResponse.notification, + ) if (payload) { ax.metric('notifications:openApp', {