Bluesky app fork with some witchin' additions 💫

Close IAB when it triggers an intent (#8454)

* Close IAB if it opens a link to the app

* native only

* await close

authored by samuel.fm and committed by

GitHub 1883f3fc 5cff45bd

+7 -1
+7 -1
src/lib/hooks/useIntentHandler.ts
··· 1 1 import React from 'react' 2 2 import {Alert} from 'react-native' 3 3 import * as Linking from 'expo-linking' 4 + import * as WebBrowser from 'expo-web-browser' 4 5 5 6 import {useOpenComposer} from '#/lib/hooks/useOpenComposer' 6 7 import {logger} from '#/logger' ··· 32 33 const {tryApplyUpdate} = useApplyPullRequestOTAUpdate() 33 34 34 35 React.useEffect(() => { 35 - const handleIncomingURL = (url: string) => { 36 + const handleIncomingURL = async (url: string) => { 37 + if (isNative) { 38 + // Close in-app browser if it's open 39 + await WebBrowser.dismissBrowser().catch(() => {}) 40 + } 41 + 36 42 const referrerInfo = Referrer.getReferrerInfo() 37 43 if (referrerInfo && referrerInfo.hostname !== 'bsky.app') { 38 44 logger.metric('deepLink:referrerReceived', {