fix rebase error

This commit is contained in:
Samuel Newman
2026-02-20 11:01:57 +02:00
parent 501186cae6
commit f936749760
+12 -6
View File
@@ -887,6 +887,11 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
const emailDialogControl = useEmailDialogControl() const emailDialogControl = useEmailDialogControl()
const closeAllActiveElements = useCloseAllActiveElements() const closeAllActiveElements = useCloseAllActiveElements()
const linkingUrl = Linking.useLinkingURL() const linkingUrl = Linking.useLinkingURL()
const [initialNotificationResponse, setInitialNotificationResponse] =
useState(() => {
if (!IS_NATIVE) return null
return Notifications.getLastNotificationResponse()
})
const [initialState] = useState(() => { const [initialState] = useState(() => {
if (!IS_NATIVE) return if (!IS_NATIVE) return
@@ -904,7 +909,7 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
// - no intent // - no intent
// - not handling a notification // - not handling a notification
if (linkingUrl) return if (linkingUrl) return
if (notificationResponse) return if (initialNotificationResponse) return
if (previousNavState.did !== currentAccount?.did) { if (previousNavState.did !== currentAccount?.did) {
return return
} }
@@ -960,15 +965,14 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
// intent urls are handled by `useIntentHandler` // intent urls are handled by `useIntentHandler`
if (linkingUrl) return if (linkingUrl) return
const notificationResponse = Notifications.getLastNotificationResponse() if (initialNotificationResponse) {
if (notificationResponse) {
notyLogger.debug(`handlePushNotificationEntry: response`, { notyLogger.debug(`handlePushNotificationEntry: response`, {
response: notificationResponse, response: initialNotificationResponse,
}) })
// Clear the last notification response to ensure it's not used again // Clear the last notification response to ensure it's not used again
try { try {
setInitialNotificationResponse(null)
Notifications.clearLastNotificationResponse() Notifications.clearLastNotificationResponse()
} catch (error) { } catch (error) {
notyLogger.error( notyLogger.error(
@@ -977,7 +981,9 @@ function RoutesContainer({children}: React.PropsWithChildren<{}>) {
) )
} }
const payload = getNotificationPayload(notificationResponse.notification) const payload = getNotificationPayload(
initialNotificationResponse.notification,
)
if (payload) { if (payload) {
ax.metric('notifications:openApp', { ax.metric('notifications:openApp', {