Skip to content

Commit

Permalink
Merge pull request #86 from ekzhang/develop
Browse files Browse the repository at this point in the history
Release 3.0.2
  • Loading branch information
ekzhang authored Feb 4, 2021
2 parents cb8c54f + 1b1c209 commit 64eea75
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions functions/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ export const finishGame = functions.https.onCall(async (data, context) => {
.database()
.ref(`games/${gameId}/mode`)
.once("value");
const { lastSet, deck, finalTime } = replayEvents(
gameData,
gameModeRef.val()
);
const gameMode = gameModeRef.val() || "normal";

const { lastSet, deck, finalTime } = replayEvents(gameData, gameMode);

if (findSet(Array.from(deck), gameModeRef.val(), lastSet)) {
if (findSet(Array.from(deck), gameMode, lastSet)) {
throw new functions.https.HttpsError(
"failed-precondition",
"The requested game has not yet ended."
Expand Down

0 comments on commit 64eea75

Please sign in to comment.