refactor: duplicating object to make sure old streak is logged

This commit is contained in:
Miodec 2023-08-31 20:24:59 +02:00
parent 76537fae4f
commit 0a163582bd

View file

@ -993,7 +993,7 @@ export async function updateStreak(
if (isYesterday(streak.lastResultTimestamp, streak.hourOffset ?? 0)) {
streak.length += 1;
} else if (!isToday(streak.lastResultTimestamp, streak.hourOffset ?? 0)) {
Logger.logToDb("streak_lost", { streak }, uid);
Logger.logToDb("streak_lost", JSON.parse(JSON.stringify(streak)), uid);
streak.length = 1;
}