|
@@ -1,5 +1,5 @@
|
|
|
import { useState, useEffect } from 'react';
|
|
|
-import { gameInfo, getGuesses } from "../../../domain/GGSHService";
|
|
|
+import { getCurrentRound } from "../../../domain/GGSHService";
|
|
|
|
|
|
export default (gameId, playerName) => {
|
|
|
const [finished, setFinished] = useState(false);
|
|
@@ -7,11 +7,9 @@ export default (gameId, playerName) => {
|
|
|
|
|
|
useEffect(() => {
|
|
|
const setup = async () => {
|
|
|
- const { currentRound } = await getGuesses(gameId, playerName);
|
|
|
+ const { currentRound, coord, timer } = await getCurrentRound(gameId, playerName);
|
|
|
if (currentRound) {
|
|
|
- const { coords, timer } = await gameInfo(gameId);
|
|
|
- const targetPoint = coords[currentRound];
|
|
|
- setRoundInfo({ currentRound, targetPoint, roundSeconds: timer });
|
|
|
+ setRoundInfo({ currentRound, targetPoint: coord, roundSeconds: timer });
|
|
|
} else {
|
|
|
setFinished(true);
|
|
|
}
|