Catch web browser errors (#8547)
* catch web browser errors * use catch instead to ensure sheetWrapper works
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
|||||||
isRelativeUrl,
|
isRelativeUrl,
|
||||||
toNiceDomain,
|
toNiceDomain,
|
||||||
} from '#/lib/strings/url-helpers'
|
} from '#/lib/strings/url-helpers'
|
||||||
|
import {logger} from '#/logger'
|
||||||
import {isNative} from '#/platform/detection'
|
import {isNative} from '#/platform/detection'
|
||||||
import {useInAppBrowser} from '#/state/preferences/in-app-browser'
|
import {useInAppBrowser} from '#/state/preferences/in-app-browser'
|
||||||
import {useTheme} from '#/alf'
|
import {useTheme} from '#/alf'
|
||||||
@@ -64,6 +65,10 @@ export function useOpenLink() {
|
|||||||
toolbarColor: t.atoms.bg.backgroundColor,
|
toolbarColor: t.atoms.bg.backgroundColor,
|
||||||
controlsColor: t.palette.primary_500,
|
controlsColor: t.palette.primary_500,
|
||||||
createTask: false,
|
createTask: false,
|
||||||
|
}).catch(err => {
|
||||||
|
if (__DEV__)
|
||||||
|
logger.error('Could not open web browser', {message: err})
|
||||||
|
Linking.openURL(url)
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user