mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-17 19:15:59 +08:00
handling undefined and null
This commit is contained in:
parent
cb166d2743
commit
4a7f8ebcb7
1 changed files with 4 additions and 1 deletions
|
@ -131,7 +131,10 @@ export async function initSnapshot(): Promise<
|
|||
snap.inboxUnreadSize = userData.inboxUnreadSize ?? 0;
|
||||
snap.streak = userData?.streak?.length ?? 0;
|
||||
snap.maxStreak = userData?.streak?.maxLength ?? 0;
|
||||
snap.streakHourOffset = userData?.streak?.hourOffset;
|
||||
|
||||
const hourOffset = userData?.streak?.hourOffset;
|
||||
snap.streakHourOffset =
|
||||
hourOffset === undefined || hourOffset === null ? undefined : hourOffset;
|
||||
|
||||
if (userData.lbMemory?.time15 || userData.lbMemory?.time60) {
|
||||
//old memory format
|
||||
|
|
Loading…
Add table
Reference in a new issue