Skip to content

Commit fc5876a

Browse files
fix(ui): stale list thumbnails when navigating (#11609)
### What? Stale list view images Thumbnail images are stale on slow connections. ### Why? The variable `fileExists` is not reset when the `fileSrc` prop changes. #### Before https://github.com/user-attachments/assets/57a2352a-8312-4070-ba16-8c4f4d4e58e2 #### After https://github.com/user-attachments/assets/ea44b460-823d-412a-bed0-425378480bb5
1 parent 72efc84 commit fc5876a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

packages/ui/src/elements/Thumbnail/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const Thumbnail: React.FC<ThumbnailProps> = (props) => {
3131
setFileExists(false)
3232
return
3333
}
34+
setFileExists(undefined)
3435

3536
const img = new Image()
3637
img.src = fileSrc
@@ -81,6 +82,7 @@ export function ThumbnailComponent(props: ThumbnailComponentProps) {
8182
setFileExists(false)
8283
return
8384
}
85+
setFileExists(undefined)
8486

8587
const img = new Image()
8688
img.src = fileSrc

0 commit comments

Comments
 (0)