Skip to content

Commit 1c1496a

Browse files
committed
Change free chapter to use historical rep
1 parent 7007ab0 commit 1c1496a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/routes/getUserInfo.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async function getPermissions(userID: HashedUserID): Promise<Record<string, bool
118118

119119
async function getFreeChaptersAccess(userID: HashedUserID): Promise<boolean> {
120120
return await oneOf([isUserVIP(userID),
121-
(async () => (await getReputation(userID)) > 0)(),
121+
(async () => !!(await db.prepare("get", `SELECT "timeSubmitted" FROM "sponsorTimes" WHERE "reputation" > 0 AND "timeSubmitted" < 1663872563000 AND "userID" = ? LIMIT 1`, [userID], { useReplica: true })))(),
122122
(async () => !!(await db.prepare("get", `SELECT "timeSubmitted" FROM "sponsorTimes" WHERE "timeSubmitted" < 1590969600000 AND "userID" = ? LIMIT 1`, [userID], { useReplica: true })))()
123123
]);
124124
}

0 commit comments

Comments
 (0)