Special-case bsky.app/download to open share sheet or copy to clipboard (#3710)
* special-case bsky.app/download to share * Address feedback * Improve detection --------- Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
This commit is contained in:
parent
b10c96f28d
commit
1af59ca8a7
4 changed files with 24 additions and 10 deletions
|
@ -1,14 +1,15 @@
|
|||
import {AtUri} from '@atproto/api'
|
||||
import {BSKY_SERVICE} from 'lib/constants'
|
||||
import TLDs from 'tlds'
|
||||
import psl from 'psl'
|
||||
import TLDs from 'tlds'
|
||||
|
||||
import {BSKY_SERVICE} from 'lib/constants'
|
||||
|
||||
export const BSKY_APP_HOST = 'https://bsky.app'
|
||||
const BSKY_TRUSTED_HOSTS = [
|
||||
'bsky.app',
|
||||
'bsky.social',
|
||||
'blueskyweb.xyz',
|
||||
'blueskyweb.zendesk.com',
|
||||
'bsky\\.app',
|
||||
'bsky\\.social',
|
||||
'blueskyweb\\.xyz',
|
||||
'blueskyweb\\.zendesk\\.com',
|
||||
...(__DEV__ ? ['localhost:19006', 'localhost:8100'] : []),
|
||||
]
|
||||
|
||||
|
@ -145,6 +146,13 @@ export function isBskyListUrl(url: string): boolean {
|
|||
return false
|
||||
}
|
||||
|
||||
export function isBskyDownloadUrl(url: string): boolean {
|
||||
if (isExternalUrl(url)) {
|
||||
return false
|
||||
}
|
||||
return url === '/download' || url.startsWith('/download?')
|
||||
}
|
||||
|
||||
export function convertBskyAppUrlIfNeeded(url: string): string {
|
||||
if (isBskyAppUrl(url)) {
|
||||
try {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue