Skip to content

Commit

Permalink
Fix: Swapped totalChar to totalHit to prevent unnessesary + 1
Browse files Browse the repository at this point in the history
  • Loading branch information
AntGa committed Oct 9, 2024
1 parent 298ade1 commit 5313f1e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/app/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export async function submitGameData(gameData: GameData) {
userId: user.id,
mode: gameData.mode,
language: gameData.language,
totalChar: gameData.totalChar,
totalChar: gameData.totalHit, //total char is buggy ig swapped to total hit
totalClicks: gameData.totalClick,
totalTime: gameData.totalTime,
accuracy: gameData.accuracy,
Expand All @@ -46,9 +46,7 @@ export async function submitGameData(gameData: GameData) {

// Determine the category (time or characters)
const category =
gameData.mode === 'time'
? `${gameData.totalTime}`
: `${gameData.totalChar}`;
gameData.mode === 'time' ? `${gameData.totalTime}` : `${gameData.totalHit}`;

// Get current user stats
const currentStats = await prisma.userStats.findUnique({
Expand Down

0 comments on commit 5313f1e

Please sign in to comment.