Browse Source

pass game outcome

pull/8/head
Tim Glasgow 2 years ago
parent
commit
335b75f1f0
  1. 5
      squarenotsquare/src/screens/Game.js

5
squarenotsquare/src/screens/Game.js

@ -97,12 +97,13 @@ function Game(props){
}
function completeChallenge(){
let finalTime = (Date.now() - startTime.current) / (1000);
clearInterval(localTimer.current);
setHeaderColor(styles.darkGreen);
setHeaderText((Date.now() - startTime.current) / (1000) + ' s');
setHeaderText(finalTime + ' s');
setTimerState(4);
setTimeout(() => {
dispatch(squareFinished(score.current));
dispatch(squareFinished(score.current, finalTime));
}, 3000);
}

Loading…
Cancel
Save