File tree Expand file tree Collapse file tree
apps/mobile/src/features/threads Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ function MessageAttachmentImage(props: {
199199
200200function ThreadMarkdownImageView ( props : {
201201 readonly uri : string | null ;
202+ readonly sourceKey : string ;
202203 readonly unavailable : boolean ;
203204 readonly alt : string | null ;
204205 readonly onPressImage : ( uri : string ) => void ;
@@ -210,6 +211,9 @@ function ThreadMarkdownImageView(props: {
210211
211212 useEffect ( ( ) => {
212213 setSourceSize ( null ) ;
214+ } , [ props . sourceKey ] ) ;
215+
216+ useEffect ( ( ) => {
213217 setFailedUri ( null ) ;
214218 } , [ props . uri ] ) ;
215219
@@ -310,6 +314,7 @@ function ThreadMarkdownImage(props: {
310314 return (
311315 < ThreadMarkdownImageView
312316 uri = { assetUrl . _tag === "Success" ? assetUrl . url : null }
317+ sourceKey = { props . path }
313318 unavailable = { assetUrl . _tag === "Failure" }
314319 alt = { props . alt }
315320 onPressImage = { props . onPressImage }
@@ -321,6 +326,7 @@ function ThreadMarkdownImageUnavailable(props: { readonly alt: string | null })
321326 return (
322327 < ThreadMarkdownImageView
323328 uri = { null }
329+ sourceKey = "unavailable"
324330 unavailable
325331 alt = { props . alt }
326332 onPressImage = { ( ) => undefined }
@@ -1573,6 +1579,7 @@ export const ThreadFeed = memo(function ThreadFeed(props: ThreadFeedProps) {
15731579 return (
15741580 < ThreadMarkdownImageView
15751581 uri = { imageSource . uri }
1582+ sourceKey = { imageSource . uri }
15761583 unavailable = { false }
15771584 alt = { image . alt }
15781585 onPressImage = { ( uri ) => setExpandedImage ( { uri } ) }
You can’t perform that action at this time.
0 commit comments