Clear the cached initial URL after handling a deep link (#11500)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Samuel Newman
2026-08-19 16:26:58 +03:00
committed by GitHub
parent c4172cef99
commit 51381d41b0
2 changed files with 12 additions and 7 deletions
+12 -1
View File
@@ -109,7 +109,18 @@ export function useIntentHandler() {
if (previousIntentUrl === incomingUrl) {
return
}
handleIncomingURL(incomingUrl)
handleIncomingURL(incomingUrl).finally(() => {
/*
* expo-linking caches the URL that launched the app and replays it to
* every new `useLinkingURL`/`getLinkingURL` caller, so an account
* switch (which remounts the tree, see `key={currentAccount?.did}` in
* `App.native.tsx`) or a runtime reload would hand us the same link
* again. Drop it now that it's been handled - this hook is the last
* consumer of the launch URL, everything else reads it while
* rendering, before this effect runs. No-op on web.
*/
Linking.clearInitialURL()
})
previousIntentUrl = incomingUrl
}
}, [
-6
View File
@@ -177,12 +177,6 @@ export function useApplyPullRequestOTAUpdate() {
updateId: fetchedUpdate.manifest.id,
})
try {
/*
* TODO: once expo-linking is upgraded to >= 57, enable this so the
* re-delivered initial URL doesn't trigger a redundant silent check
* after the reload.
*/
// Linking.clearInitialURL()
await reloadAsync({
reloadScreenOptions: splash(t.scheme),
})