Add a lil check to shadow handling
This commit is contained in:
Vendored
+9
-2
@@ -91,8 +91,15 @@ function mergeShadow(
|
|||||||
repostCount = Math.max(0, repostCount)
|
repostCount = Math.max(0, repostCount)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shadow.embed !== undefined && post.embed) {
|
if ('embed' in shadow) {
|
||||||
post.embed = shadow.embed
|
if (
|
||||||
|
(AppBskyEmbedRecord.isView(post.embed) &&
|
||||||
|
AppBskyEmbedRecord.isView(shadow.embed)) ||
|
||||||
|
(AppBskyEmbedRecordWithMedia.isView(post.embed) &&
|
||||||
|
AppBskyEmbedRecordWithMedia.isView(shadow.embed))
|
||||||
|
) {
|
||||||
|
post.embed = shadow.embed
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return castAsShadow({
|
return castAsShadow({
|
||||||
|
|||||||
Reference in New Issue
Block a user