Skip to content

Commit 22b24cb

Browse files
committed
fix(mobile): isolate markdown image requests
1 parent 5a7a7cf commit 22b24cb

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

‎apps/mobile/src/features/threads/ThreadFeed.tsx‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,6 @@ function ThreadMarkdownImageView(props: {
209209
const [availableWidth, setAvailableWidth] = useState(0);
210210
const [sourceSize, setSourceSize] = useState<{ width: number; height: number } | null>(null);
211211
const [failedUri, setFailedUri] = useState<string | null>(null);
212-
const activeUriRef = useRef(props.uri);
213-
activeUriRef.current = props.uri;
214212

215213
useEffect(() => {
216214
setSourceSize(null);
@@ -273,11 +271,11 @@ function ThreadMarkdownImageView(props: {
273271
}}
274272
>
275273
<Image
274+
key={props.uri}
276275
source={{ uri: props.uri }}
277276
resizeMode="contain"
278277
accessible={false}
279278
onLoad={(event) => {
280-
if (activeUriRef.current !== props.uri) return;
281279
const { width, height } = event.nativeEvent.source;
282280
setSourceSize({ width, height });
283281
}}

0 commit comments

Comments
 (0)