fix time and ignore duplciate scans in score keeping
All checks were successful
Build Images and Deploy / Update-PROD-Stack (push) Successful in 28s

This commit is contained in:
2026-02-28 03:14:24 -05:00
parent 5b31d3079b
commit ab3a88dbc0
2 changed files with 8 additions and 4 deletions

View File

@@ -352,10 +352,8 @@ const Scans = {
const alreadyScanned = this.hasUserScanned(packageId, userId);
if (alreadyScanned) {
// No points, but update last_scanned_by so they can edit the hint
// No points — don't store 0-point scans, just update last_scanned_by
db.prepare('UPDATE packages SET last_scanned_by = ? WHERE id = ?').run(userId, packageId);
// Record the scan with 0 points
db.prepare('INSERT INTO scans (package_id, user_id, points_awarded) VALUES (?, ?, 0)').run(packageId, userId);
return { points: 0, alreadyScanned: true, isFirst: false };
}