Skip to content

Commit

Permalink
more awaits
Browse files Browse the repository at this point in the history
  • Loading branch information
mariansam committed Jun 15, 2023
1 parent 657fb1f commit a246edb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/pages/admin/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,13 @@ export const AdminHomePage: React.FC = () => {
const saveStartNext = async () => {
if (!team1 || !team2 || !currentGame.game)
return;
await savePoints(team1, team2, newPoints1, newPoints2);
await finishGame(currentGame.game);
await startGameNo(showGameNo + 1);

await Promise.all([
savePoints(team1, team2, newPoints1, newPoints2),
finishGame(currentGame.game),
startGameNo(showGameNo + 1),
]);

showNextGame();
}

Expand Down

0 comments on commit a246edb

Please sign in to comment.