Skip to content

Commit 4654dc9

Browse files
committed
fix(mobile): images in the body cannot be displayed without specified width and height
1 parent 3ddf461 commit 4654dc9

File tree

1 file changed

+5
-4
lines changed
  • apps/mobile/web-app/html-renderer/src/components

1 file changed

+5
-4
lines changed

apps/mobile/web-app/html-renderer/src/components/image.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const MarkdownImage = (props: HTMLProps<"img">) => {
5353
})
5454
}}
5555
>
56-
{image?.blurhash && (
56+
{image?.blurhash && scaleWidth && scaleHeight && (
5757
<Blurhash
5858
hash={image.blurhash}
5959
width={scaleWidth}
@@ -68,13 +68,14 @@ export const MarkdownImage = (props: HTMLProps<"img">) => {
6868
{...rest}
6969
onLoad={() => setIsLoading(false)}
7070
style={{
71-
width: scaleWidth,
72-
height: scaleHeight,
71+
width: scaleWidth || undefined,
72+
height: scaleHeight || undefined,
7373
}}
7474
loading="lazy"
7575
className={clsx(
76-
"absolute inset-0 !my-0 transition-opacity duration-500",
76+
"!my-0 transition-opacity duration-500",
7777
isLoading && "opacity-0",
78+
scaleWidth && scaleHeight && "absolute inset-0",
7879
)}
7980
crossOrigin="anonymous"
8081
src={src}

0 commit comments

Comments
 (0)