diff --git a/squarenotsquare/src/redux/actions/UserActions.js b/squarenotsquare/src/redux/actions/UserActions.js index 7bd1930..d64eadf 100644 --- a/squarenotsquare/src/redux/actions/UserActions.js +++ b/squarenotsquare/src/redux/actions/UserActions.js @@ -10,14 +10,16 @@ export function squareStartPressed() { } } -export function squareFinished(score, finalTime) { +export function squareFinished(answers, finalTime) { return (dispatch, getState) => { - squareNav('Score'); - let newUser = getState().user; + setTimeout(() => squareNav('Score'), 3000); + const userState = getState().user; + let newUser = {...userState}; newUser.lastGameTime = finalTime; - newUser.lastGameScore = score; + newUser.lastGameAnswers = answers; dispatch({ - type: SQUARE_FINISHED + type: SQUARE_FINISHED, + user: newUser }); } } \ No newline at end of file