Fix rendering of feed and list post-embeds (close #1131) (#1135)

zio/stable
Paul Frazee 2023-08-08 11:34:33 -07:00 committed by GitHub
parent 3c29a1be4d
commit 72e459f3e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 19 deletions

View File

@ -57,9 +57,20 @@ export function PostEmbeds({
)
}
// quote post
// =
if (AppBskyEmbedRecord.isView(embed)) {
// custom feed embed (i.e. generator view)
// =
if (AppBskyFeedDefs.isGeneratorView(embed.record)) {
return <CustomFeedEmbed record={embed.record} />
}
// list embed (e.g. mute lists; i.e. ListView)
if (AppBskyGraphDefs.isListView(embed.record)) {
return <ListEmbed item={embed.record} />
}
// quote post
// =
return <MaybeQuoteEmbed embed={embed} style={style} />
}
@ -119,23 +130,6 @@ export function PostEmbeds({
}
}
// custom feed embed (i.e. generator view)
// =
if (
AppBskyEmbedRecord.isView(embed) &&
AppBskyFeedDefs.isGeneratorView(embed.record)
) {
return <CustomFeedEmbed record={embed.record} />
}
// list embed (e.g. mute lists; i.e. ListView)
if (
AppBskyEmbedRecord.isView(embed) &&
AppBskyGraphDefs.isListView(embed.record)
) {
return <ListEmbed item={embed.record} />
}
// external link embed
// =
if (AppBskyEmbedExternal.isView(embed)) {