diff --git a/src/lib/PostComponent.svelte b/src/lib/PostComponent.svelte index 3b4ed68..43ad667 100644 --- a/src/lib/PostComponent.svelte +++ b/src/lib/PostComponent.svelte @@ -141,6 +141,13 @@ controls > {/if} + {#if post.gifLink} + Post GIF + {/if} diff --git a/src/lib/pdsfetch.ts b/src/lib/pdsfetch.ts index 79edab0..e782f62 100644 --- a/src/lib/pdsfetch.ts +++ b/src/lib/pdsfetch.ts @@ -46,6 +46,7 @@ class Post { replyingUri: atUriObject | null; imagesCid: string[] | null; videosLinkCid: string | null; + gifLink: string | null; constructor( record: ComAtprotoRepoListRecords.Record, @@ -69,6 +70,7 @@ class Post { this.quotingUri = null; this.imagesCid = null; this.videosLinkCid = null; + this.gifLink = null; switch (post.embed?.$type) { case "app.bsky.embed.images": this.imagesCid = post.embed.images.map( @@ -96,6 +98,9 @@ class Post { break; } break; + case "app.bsky.embed.external": // assuming that external embeds are gifs for now + this.gifLink = post.embed.external.uri; + break; } } }