Skip to content

Commit

Permalink
handled (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
FrankreedX committed Jul 9, 2024
1 parent 993736d commit 655386d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions app/segments/drill/[id]/submission/input.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async function handleLeaderboardUpdate(
const mainOutputAttempt = drillInfo.mainOutputAttempt;

//check if the user exists on the leaderboard
if (currentLeaderboard[uploadData.uid] == undefined) {
if (currentLeaderboard[uploadData.uid] === undefined) {
console.log("User not on leaderboard, uploading this attempt");

await uploadNewLeaderboard(
Expand Down Expand Up @@ -648,13 +648,17 @@ function createOutputData(drillInfo, inputValues, attemptShots, uid, did) {
break;

case "leftSideLandingAverage":
outputData.leftSideLandingAverage =
leftSideLandingTotal / missedLeftShotCount;
if (!missedLeftShotCount) outputData.leftSideLandingAverage = 0;
else
outputData.leftSideLandingAverage =
leftSideLandingTotal / missedLeftShotCount;
break;

case "rightSideLandingAverage":
outputData.rightSideLandingAverage =
rightSideLandingTotal / missedRightShotCount;
if (!missedRightShotCount) outputData.rightSideLandingAverage = 0;
else
outputData.rightSideLandingAverage =
rightSideLandingTotal / missedRightShotCount;
break;

case "sideLandingTotal":
Expand Down

0 comments on commit 655386d

Please sign in to comment.