Skip to content

Commit

Permalink
fix(annotation-reducer): SET_FILE_DATA requires a shallow copy
Browse files Browse the repository at this point in the history
Avoiding changes to readable attributes
  • Loading branch information
Kerwin-L committed Sep 2, 2022
1 parent b808c4d commit 09d7185
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/lb-components/src/store/annotation/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -538,11 +538,12 @@ export const annotationReducer = (
case ANNOTATION_ACTIONS.SET_FILE_DATA: {
const { fileData, index } = action.payload;
const { imgList } = state;
imgList[index] = { ...imgList[index], ...fileData };
const newImgList = [...imgList];
newImgList[index] = { ...newImgList[index], ...fileData };

return {
...state,
imgList,
imgList: newImgList,
};
}

Expand Down

0 comments on commit 09d7185

Please sign in to comment.