Skip to content

Commit af90e20

Browse files
committed
corrected mistake
1 parent d14e3ea commit af90e20

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/reducer/reducer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ const reducer = (state, action) => {
141141

142142
case T.SET_FILE_HANDLE: {
143143
const newState = { ...state };
144-
newState.graphs = newState.graphs.map((g) => (
145-
newState.curGraphIndex === action.payload.curGraphIndex ? { ...g, fileHandle: action.payload.fileHandle }
144+
newState.graphs = newState.graphs.map((g, index) => (
145+
index === action.payload.curGraphIndex ? { ...g, fileHandle: action.payload.fileHandle }
146146
: g
147147
));
148148
return { ...newState };

0 commit comments

Comments
 (0)