mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-11 01:44:50 +08:00
updating local data
This commit is contained in:
parent
949e49cfa2
commit
4031bc55a6
1 changed files with 5 additions and 0 deletions
|
|
@ -831,6 +831,11 @@ export function addBadge(badge: MonkeyTypes.Badge): void {
|
|||
export function setStreak(streak: number): void {
|
||||
const snapshot = getSnapshot();
|
||||
snapshot.streak = streak;
|
||||
|
||||
if (snapshot.streak > snapshot.maxStreak) {
|
||||
snapshot.maxStreak = snapshot.streak;
|
||||
}
|
||||
|
||||
setSnapshot(snapshot);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue