Files
bsky-social-app/src/platform/urls.tsx
T
Eric Bailey 9df5caf3c5 Update hashtag menu to use Menu, convert to native link for additional a11y and click handling (#7529)
* Make tag a normal link on web

* Replace old TagMenu with new RichTextTag component, expand and improve click utils

* Clarify intents

* Ensure we're passing down hint

* ope

* DRY
2025-01-21 21:56:01 +00:00

27 lines
557 B
TypeScript

import {Linking} from 'react-native'
import {isNative, isWeb} from './detection'
export async function getInitialURL(): Promise<string | undefined> {
if (isNative) {
const url = await Linking.getInitialURL()
if (url) {
return url
}
return undefined
} else {
// @ts-ignore window exists -prf
if (window.location.pathname !== '/') {
return window.location.pathname
}
return undefined
}
}
export function clearHash() {
if (isWeb) {
// @ts-ignore window exists -prf
window.location.hash = ''
}
}