Skip to content

Commit

Permalink
fix: image-preview refresh problem
Browse files Browse the repository at this point in the history
  • Loading branch information
yeling committed Sep 21, 2023
1 parent e452e40 commit 1f0191f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions packages/arcodesign/components/image-preview/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -852,12 +852,14 @@ const ImagePreview = forwardRef((props: ImagePreviewProps, ref: Ref<ImagePreview
* @en Change specified image status
*/
function setImagesStatusByIndex(index: number, data: PreviewImageStatus) {
const newStatus = imagesStatusRef.current.slice();
newStatus[index] = {
...(newStatus[index] || {}),
...data,
};
setImagesStatus(newStatus);
setImagesStatus(current => {
const newStatus = current.slice();
newStatus[index] = {
...(newStatus[index] || {}),
...data,
};
return newStatus;
});
}

/**
Expand Down

0 comments on commit 1f0191f

Please sign in to comment.