Skip to content

Commit

Permalink
fix(Block): ensure currentAction is reset to null on error and spread…
Browse files Browse the repository at this point in the history
… currentAction state
  • Loading branch information
drikusroor committed Nov 27, 2024
1 parent 64713ff commit 3302e26
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion frontend/src/components/Block/Block.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const Block = () => {
setActions(newActions);
const newState = newActions.shift();
const currentAction = newState ? newState : null;
setCurrentAction(currentAction);
setCurrentAction({ ...currentAction });
updateState(newState);
}, [updateState]);

Expand All @@ -84,6 +84,7 @@ const Block = () => {
setError(
"An error occured while loading the data, please try to reload the page. (Error: next_round data unavailable)"
);
setCurrentAction(null);
setState(null);
}
};
Expand Down

0 comments on commit 3302e26

Please sign in to comment.