mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-27 08:13:28 +08:00
fixed everyuser getting houroffset 0 automatically
This commit is contained in:
parent
d500e06d9b
commit
cb166d2743
1 changed files with 9 additions and 0 deletions
|
@ -988,6 +988,15 @@ export async function updateStreak(
|
|||
}
|
||||
|
||||
streak.lastResultTimestamp = timestamp;
|
||||
|
||||
delete streak.hourOffset; // make sure we dont overwrite the hour offset
|
||||
|
||||
if (user.streak?.hourOffset === 0) {
|
||||
// todo this needs to be removed after a while
|
||||
//@ts-ignore
|
||||
streak.hourOffset = undefined;
|
||||
}
|
||||
|
||||
await getUsersCollection().updateOne({ uid }, { $set: { streak } });
|
||||
|
||||
return streak.length;
|
||||
|
|
Loading…
Reference in a new issue