Skip to content

Commit 4f2039c

Browse files
fix: turing leaderboard data + start on first move
1 parent 167c1cb commit 4f2039c

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

src/api/profile/profile.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ export const getPlayerStats = async (name?: string): Promise<PlayerStats> => {
4141
botNotRating: data.turing_elo as number,
4242
botNotCorrect: data.turing_guesses_correct as number,
4343
botNotWrong: data.turing_guesses_wrong as number,
44+
botNotGames: (data.turing_guesses_correct +
45+
data.turing_guesses_wrong) as number,
4446
botNotMax: data.turing_elo_max as number,
4547
botNotMin: data.turing_elo_min as number,
4648
botNotHours: data.turing_game_time as number,

src/components/Leaderboard/LeaderboardEntry.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,18 @@ export const LeaderboardEntry = ({
3434
| 'botNotRating'
3535
| 'handRating'
3636
| 'brainRating'
37+
3738
let highestRatingKey:
3839
| 'regularMax'
3940
| 'trainMax'
4041
| 'botNotMax'
4142
| 'handMax'
4243
| 'brainMax'
44+
4345
let gamesKey:
4446
| 'regularGames'
4547
| 'trainGames'
46-
| 'botNotCorrect'
48+
| 'botNotGames'
4749
| 'handGames'
4850
| 'brainGames'
4951

@@ -70,7 +72,7 @@ export const LeaderboardEntry = ({
7072
case 'turing':
7173
ratingKey = 'botNotRating'
7274
highestRatingKey = 'botNotMax'
73-
gamesKey = 'botNotCorrect'
75+
gamesKey = 'botNotGames'
7476
gamesWonKey = 'botNotCorrect'
7577
break
7678
case 'hand':

src/hooks/useTuringController/useTuringController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export const useTuringController = () => {
8181
useEffect(() => {
8282
if (gameTree && game) {
8383
const mainLine = gameTree.getMainLine()
84-
controller.setCurrentNode(mainLine[mainLine.length - 1])
84+
controller.setCurrentNode(mainLine[0])
8585
}
8686
}, [game])
8787

src/pages/api/active-users.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,6 @@ async function fetchActiveUsersFromPostHog(): Promise<number | null> {
7575
}),
7676
})
7777

78-
console.log(`
79-
SELECT count(DISTINCT person_id) as recent_users
80-
FROM events
81-
WHERE event = '$pageview'
82-
AND timestamp > TIMESTAMP '${twentyFourHoursAgo}'
83-
`)
84-
8578
if (!response.ok) {
8679
const errorText = await response.text()
8780
throw new Error(errorText)

src/types/auth/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export interface PlayerStats {
3939
botNotRating: number
4040
botNotCorrect: number
4141
botNotWrong: number
42+
botNotGames: number
4243
botNotMax: number
4344
botNotMin: number
4445
botNotHours: number

0 commit comments

Comments
 (0)