|
@@ -5,6 +5,7 @@ import GuessPane from "./GuessPane";
|
|
import PositionedStreetView from "./PositionedStreetView";
|
|
import PositionedStreetView from "./PositionedStreetView";
|
|
import useRoundInfo from "../../../hooks/useRoundInfo";
|
|
import useRoundInfo from "../../../hooks/useRoundInfo";
|
|
import { dispatch } from '../../../domain/gameStore';
|
|
import { dispatch } from '../../../domain/gameStore';
|
|
|
|
+import { useTimerFromLocalStorage } from '../../../domain/localStorageMethods';
|
|
|
|
|
|
const Container = styled.div`
|
|
const Container = styled.div`
|
|
height: 100%;
|
|
height: 100%;
|
|
@@ -44,6 +45,8 @@ export default () => {
|
|
return <Loading/>
|
|
return <Loading/>
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ const storedTimer = useTimerFromLocalStorage();
|
|
|
|
+
|
|
const handleSubmitGuess = async () => {
|
|
const handleSubmitGuess = async () => {
|
|
setSubmitDisabled(true);
|
|
setSubmitDisabled(true);
|
|
await dispatch.submitGuess(selectedPoint, currentRound, targetPoint);
|
|
await dispatch.submitGuess(selectedPoint, currentRound, targetPoint);
|
|
@@ -55,7 +58,7 @@ export default () => {
|
|
<PositionedStreetView position={targetPoint} />
|
|
<PositionedStreetView position={targetPoint} />
|
|
</StreetViewWrapper>
|
|
</StreetViewWrapper>
|
|
<GuessPane
|
|
<GuessPane
|
|
- roundSeconds={roundSeconds}
|
|
|
|
|
|
+ roundSeconds={storedTimer ?? roundSeconds}
|
|
onTimeout={handleSubmitGuess}
|
|
onTimeout={handleSubmitGuess}
|
|
onSelectPoint={setSelectedPoint}
|
|
onSelectPoint={setSelectedPoint}
|
|
onSubmitGuess={handleSubmitGuess}
|
|
onSubmitGuess={handleSubmitGuess}
|