From d7b8c32c10b1d6a9862789b826cabe290b44788b Mon Sep 17 00:00:00 2001 From: Ajay Ramachandran Date: Thu, 15 Jul 2021 12:32:00 -0400 Subject: [PATCH] Remove lock when undoing vote --- 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 7c9251e..eb873a0 100644 --- a/src/routes/voteOnSponsorTime.ts +++ b/src/routes/voteOnSponsorTime.ts @@ -428,7 +428,7 @@ export async function voteOnSponsorTime(req: Request, res: Response): Promise 0 && voteTypeEnum === voteTypes.normal) { // Unide and Lock this submission await db.prepare('run', 'UPDATE "sponsorTimes" SET locked = 1, hidden = 0 WHERE "UUID" = ?', [UUID]); - } else if (isVIP && incrementAmount < 0 && voteTypeEnum === voteTypes.normal) { + } else if (isVIP && incrementAmount <= 0 && voteTypeEnum === voteTypes.normal) { // Unlock if a VIP downvotes it await db.prepare('run', 'UPDATE "sponsorTimes" SET locked = 0 WHERE "UUID" = ?', [UUID]); }