From 5313f1e7dbf5a43eb6fbec251953e4de194d0c8e Mon Sep 17 00:00:00 2001 From: Anton Garay Date: Wed, 9 Oct 2024 19:40:15 +1300 Subject: [PATCH] Fix: Swapped totalChar to totalHit to prevent unnessesary + 1 --- src/app/actions.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/app/actions.ts b/src/app/actions.ts index ca4bafd..a869e63 100644 --- a/src/app/actions.ts +++ b/src/app/actions.ts @@ -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, @@ -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({