From 9c0f0d8e4f4532a32ffcb53b53c0827f7db69c28 Mon Sep 17 00:00:00 2001 From: mini-bomba <55105495+mini-bomba@users.noreply.github.com> Date: Thu, 14 Jul 2022 20:28:45 +0200 Subject: [PATCH] voteOnSponsorTime: simplify currentCategoryCount computation in categoryVote --- src/routes/voteOnSponsorTime.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/voteOnSponsorTime.ts b/src/routes/voteOnSponsorTime.ts index bd92ac9..7f308ef 100644 --- a/src/routes/voteOnSponsorTime.ts +++ b/src/routes/voteOnSponsorTime.ts @@ -279,7 +279,7 @@ async function categoryVote(UUID: SegmentUUID, userID: UserID, isVIP: boolean, i // Change this value from 1 in the future to make it harder to change categories // Done this way without ORs incase the value is zero - const currentCategoryCount = (currentCategoryInfo === undefined || currentCategoryInfo === null) ? startingVotes : currentCategoryInfo.votes; + const currentCategoryCount = currentCategoryInfo?.votes ?? startingVotes; // Add submission as vote if (!currentCategoryInfo && submissionInfo) {