fix: exempt well-known paths from being handled (#2505)
parent
ddca849e0d
commit
2be2733082
|
@ -306,6 +306,8 @@ export const TextLinkOnWebOnly = memo(function DesktopWebTextLink({
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const EXEMPT_PATHS = ['/robots.txt', '/security.txt', '/.well-known/']
|
||||||
|
|
||||||
// NOTE
|
// NOTE
|
||||||
// we can't use the onPress given by useLinkProps because it will
|
// we can't use the onPress given by useLinkProps because it will
|
||||||
// match most paths to the HomeTab routes while we actually want to
|
// match most paths to the HomeTab routes while we actually want to
|
||||||
|
@ -350,7 +352,12 @@ function onPressInner(
|
||||||
|
|
||||||
if (shouldHandle) {
|
if (shouldHandle) {
|
||||||
href = convertBskyAppUrlIfNeeded(href)
|
href = convertBskyAppUrlIfNeeded(href)
|
||||||
if (newTab || href.startsWith('http') || href.startsWith('mailto')) {
|
if (
|
||||||
|
newTab ||
|
||||||
|
href.startsWith('http') ||
|
||||||
|
href.startsWith('mailto') ||
|
||||||
|
EXEMPT_PATHS.some(path => href.startsWith(path))
|
||||||
|
) {
|
||||||
openLink(href)
|
openLink(href)
|
||||||
} else {
|
} else {
|
||||||
closeModal() // close any active modals
|
closeModal() // close any active modals
|
||||||
|
|
Loading…
Reference in New Issue