resolve short links
This commit is contained in:
@@ -12,11 +12,13 @@ import {
|
||||
getPostAsQuote,
|
||||
} from 'lib/link-meta/bsky'
|
||||
import {getLinkMeta} from 'lib/link-meta/link-meta'
|
||||
import {resolveShortLink} from 'lib/link-meta/resolve-short-link'
|
||||
import {downloadAndResize} from 'lib/media/manip'
|
||||
import {
|
||||
isBskyCustomFeedUrl,
|
||||
isBskyListUrl,
|
||||
isBskyPostUrl,
|
||||
isShortLink,
|
||||
} from 'lib/strings/url-helpers'
|
||||
import {ImageModel} from 'state/models/media/image'
|
||||
import {ComposerOpts} from 'state/shell/composer'
|
||||
@@ -94,6 +96,17 @@ export function useExternalLinkFetch({
|
||||
setExtLink(undefined)
|
||||
},
|
||||
)
|
||||
} else if (isShortLink(extLink.uri)) {
|
||||
if (isShortLink(extLink.uri)) {
|
||||
resolveShortLink(extLink.uri).then(res => {
|
||||
if (res && res !== extLink.uri) {
|
||||
setExtLink({
|
||||
uri: res,
|
||||
isLoading: true,
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
getLinkMeta(agent, extLink.uri).then(meta => {
|
||||
if (aborted) {
|
||||
|
||||
Reference in New Issue
Block a user