about summary refs log tree commit diff
path: root/src/components/MediaPreview.tsx
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2025-03-14 10:28:02 -0500
committerGitHub <noreply@github.com>2025-03-14 10:28:02 -0500
commit9cea7f0393a3bdd5b020f014ed1f8929a5755342 (patch)
tree1b5e955ca473a12adab5ce9b37f9d9d1fbc49cea /src/components/MediaPreview.tsx
parentdcc8b351464727e2780b279338dd46589424784e (diff)
downloadvoidsky-9cea7f0393a3bdd5b020f014ed1f8929a5755342.tar.zst
Fix missing RecordWithMedia media embed preview in notifications view (#7988)
Diffstat (limited to 'src/components/MediaPreview.tsx')
-rw-r--r--src/components/MediaPreview.tsx8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/components/MediaPreview.tsx b/src/components/MediaPreview.tsx
index 6e368e7dc..208973cc9 100644
--- a/src/components/MediaPreview.tsx
+++ b/src/components/MediaPreview.tsx
@@ -54,6 +54,14 @@ export function Embed({
         <VideoItem thumbnail={e.view.thumbnail} alt={e.view.alt} />
       </Outer>
     )
+  } else if (
+    e.type === 'post_with_media' &&
+    // ignore further "nested" RecordWithMedia
+    e.media.type !== 'post_with_media' &&
+    // ignore any unknowns
+    e.media.view !== null
+  ) {
+    return <Embed embed={e.media.view} style={style} />
   }
 
   return null