Fix unwarn not working

This commit is contained in:
Ajay Ramachandran
2021-01-24 12:45:13 -05:00
parent 4561148ab2
commit 3b24dfd4c5
2 changed files with 33 additions and 1 deletions

View File

@@ -302,7 +302,7 @@ export async function postSkipSegments(req: Request, res: Response) {
const MILLISECONDS_IN_HOUR = 3600000;
const now = Date.now();
const warningsCount = db.prepare('get', "SELECT count(1) as count FROM warnings WHERE userID = ? AND issueTime > ?",
const warningsCount = db.prepare('get', "SELECT count(1) as count FROM warnings WHERE userID = ? AND issueTime > ? AND enabled = 1",
[userID, Math.floor(now - (config.hoursAfterWarningExpires * MILLISECONDS_IN_HOUR))],
).count;