Skip to content

Commit 882e318

Browse files
committed
Fix isUniqueByChar, recalculate streaks again :\
1 parent 8878c38 commit 882e318

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-- Clear Streak and StreakGame tables
2+
3+
DELETE FROM "StreakGame";
4+
DELETE FROM "Streak";

apps/api/src/app/getters/getStreaks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ export const getStreaksByPlayer = async (player: { id: Player['id'] }) => {
4949
}))
5050

5151
const winChars = games.filter((game) => game.isWin).map((game) => game.char)
52-
const isUniqueByChar = new Set(winChars).size === games.length
52+
const isUniqueByChar = new Set(winChars).size === winChars.length
5353
const isMono = new Set(winChars).size === 1
5454
const type: StreakType = isUniqueByChar
5555
? StreakType.UNIQUE

0 commit comments

Comments
 (0)