Skip to content

Commit b66f53a

Browse files
committed
fix empty body broken image display
1 parent 48824e3 commit b66f53a

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
sable: patch
3+
---
4+
5+
Fix images without an empty body display as "Broken Message"

src/app/components/RenderMessageContent.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@ function RenderMessageContentInternal({
120120
);
121121

122122
const renderCaption = () => {
123+
const hasCaption = content.body && content.body.trim().length > 0;
123124
if (captionPosition === CaptionPosition.Hidden) return null;
124-
if (content.filename && content.filename !== content.body) {
125+
if (hasCaption && content.filename && content.filename !== content.body) {
125126
if (captionPosition !== CaptionPosition.Inline)
126127
return (
127128
<MText

0 commit comments

Comments
 (0)