From 107b21c463c892d48324619c58db35edac30349a Mon Sep 17 00:00:00 2001 From: Michael C Date: Fri, 2 Jul 2021 21:57:00 -0400 Subject: [PATCH] restore hidden segments with vip upvote --- src/routes/voteOnSponsorTime.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/voteOnSponsorTime.ts b/src/routes/voteOnSponsorTime.ts index 5bbe43a..ef75f6c 100644 --- a/src/routes/voteOnSponsorTime.ts +++ b/src/routes/voteOnSponsorTime.ts @@ -428,8 +428,8 @@ export async function voteOnSponsorTime(req: Request, res: Response) { //oldIncrementAmount will be zero is row is null await db.prepare('run', 'UPDATE "sponsorTimes" SET "' + columnName + '" = "' + columnName + '" + ? WHERE "UUID" = ?', [incrementAmount - oldIncrementAmount, UUID]); if (isVIP && incrementAmount > 0 && voteTypeEnum === voteTypes.normal) { - // Lock this submission - await db.prepare('run', 'UPDATE "sponsorTimes" SET locked = 1 WHERE "UUID" = ?', [UUID]); + // 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) { // Unlock if a VIP downvotes it await db.prepare('run', 'UPDATE "sponsorTimes" SET locked = 0 WHERE "UUID" = ?', [UUID]);