Clear the cached initial URL after handling a deep link (#11500)
Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -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
|
||||
}
|
||||
}, [
|
||||
|
||||
@@ -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),
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user