about summary refs log tree commit diff
path: root/src/view/com/composer/useExternalLinkFetch.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com/composer/useExternalLinkFetch.ts')
-rw-r--r--src/view/com/composer/useExternalLinkFetch.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/view/com/composer/useExternalLinkFetch.ts b/src/view/com/composer/useExternalLinkFetch.ts
index 2e0297a47..743535a5e 100644
--- a/src/view/com/composer/useExternalLinkFetch.ts
+++ b/src/view/com/composer/useExternalLinkFetch.ts
@@ -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) {