voteOnSponsorTime: simplify currentCategoryCount computation in categoryVote

This commit is contained in:
mini-bomba 2022-07-14 20:28:45 +02:00
parent f24a1415da
commit 9c0f0d8e4f
No known key found for this signature in database
GPG key ID: 30F8B138B4794886

View file

@ -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) {