Browse Source

Merge branch 'development' into feature/promiseMigration

feature/promiseMigration
Nareshkumar Rao 3 years ago
parent
commit
1f05ebb8cd
  1. 4
      src/db/models/User.helper.ts

4
src/db/models/User.helper.ts

@ -39,8 +39,8 @@ export async function getUserCovidPositivity(
): Promise<boolean> { ): Promise<boolean> {
const user = await getUserByTelegramID(telegramID); const user = await getUserByTelegramID(telegramID);
if (!user) throw new Error("User not found"); if (!user) throw new Error("User not found");
const infectionDuration = +user.infectionDate - Date.now();
if (infectionDuration > 60 * 60 * 24 * 14) {
const infectionDuration = Date.now() - +user.infectionDate;
if (infectionDuration > 60 * 60 * 24 * 14 * 1000) {
await setUserCovidPositivity(telegramID, false); await setUserCovidPositivity(telegramID, false);
return false; return false;
} else { } else {

Loading…
Cancel
Save