Move intent handler to a child of InnerApp (#5695)
This commit is contained in:
@@ -13,6 +13,9 @@ type IntentType = 'compose' | 'verify-email'
|
||||
|
||||
const VALID_IMAGE_REGEX = /^[\w.:\-_/]+\|\d+(\.\d+)?\|\d+(\.\d+)?$/
|
||||
|
||||
// This needs to stay outside of react to persist between account switches
|
||||
let previousIntentUrl = ''
|
||||
|
||||
export function useIntentHandler() {
|
||||
const incomingUrl = Linking.useURL()
|
||||
const composeIntent = useComposeIntent()
|
||||
@@ -68,7 +71,13 @@ export function useIntentHandler() {
|
||||
}
|
||||
}
|
||||
|
||||
if (incomingUrl) handleIncomingURL(incomingUrl)
|
||||
if (incomingUrl) {
|
||||
if (previousIntentUrl === incomingUrl) {
|
||||
return
|
||||
}
|
||||
handleIncomingURL(incomingUrl)
|
||||
previousIntentUrl = incomingUrl
|
||||
}
|
||||
}, [incomingUrl, composeIntent, verifyEmailIntent])
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user