show video in quote (#5093)

zio/stable
Samuel Newman 2024-09-03 18:33:16 +01:00 committed by GitHub
parent dde72b48e1
commit bd42f770b8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 2 deletions

View File

@ -11,6 +11,7 @@ import {
AppBskyEmbedImages, AppBskyEmbedImages,
AppBskyEmbedRecord, AppBskyEmbedRecord,
AppBskyEmbedRecordWithMedia, AppBskyEmbedRecordWithMedia,
AppBskyEmbedVideo,
AppBskyFeedDefs, AppBskyFeedDefs,
AppBskyFeedPost, AppBskyFeedPost,
ModerationDecision, ModerationDecision,
@ -180,12 +181,17 @@ export function QuoteEmbed({
if (allowNestedQuotes) { if (allowNestedQuotes) {
return e return e
} else { } else {
if (AppBskyEmbedImages.isView(e) || AppBskyEmbedExternal.isView(e)) { if (
AppBskyEmbedImages.isView(e) ||
AppBskyEmbedExternal.isView(e) ||
AppBskyEmbedVideo.isView(e)
) {
return e return e
} else if ( } else if (
AppBskyEmbedRecordWithMedia.isView(e) && AppBskyEmbedRecordWithMedia.isView(e) &&
(AppBskyEmbedImages.isView(e.media) || (AppBskyEmbedImages.isView(e.media) ||
AppBskyEmbedExternal.isView(e.media)) AppBskyEmbedExternal.isView(e.media) ||
AppBskyEmbedVideo.isView(e.media))
) { ) {
return e.media return e.media
} }

View File

@ -86,6 +86,7 @@ export function PostEmbeds({
return <MaybeListCard view={embed.record} /> return <MaybeListCard view={embed.record} />
} }
// starter pack embed
if (AppBskyGraphDefs.isStarterPackViewBasic(embed.record)) { if (AppBskyGraphDefs.isStarterPackViewBasic(embed.record)) {
return <StarterPackCard starterPack={embed.record} /> return <StarterPackCard starterPack={embed.record} />
} }
@ -178,6 +179,8 @@ export function PostEmbeds({
) )
} }
// video embed
// =
if (AppBskyEmbedVideo.isView(embed)) { if (AppBskyEmbedVideo.isView(embed)) {
return ( return (
<ContentHider modui={moderation?.ui('contentMedia')}> <ContentHider modui={moderation?.ui('contentMedia')}>