mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-24 06:48:02 +08:00
checking if properties exist
This commit is contained in:
parent
aa4519573b
commit
a58189d3af
1 changed files with 12 additions and 11 deletions
|
|
@ -1720,19 +1720,20 @@ async function saveResult(
|
|||
DB.setStreak(response.data.streak);
|
||||
}
|
||||
|
||||
completedEvent._id = response.data.insertedId;
|
||||
if (response?.data?.isPb) {
|
||||
completedEvent.isPb = true;
|
||||
if (response?.data?.insertedId) {
|
||||
completedEvent._id = response.data.insertedId;
|
||||
if (response?.data?.isPb) {
|
||||
completedEvent.isPb = true;
|
||||
}
|
||||
DB.saveLocalResult(completedEvent);
|
||||
DB.updateLocalStats(
|
||||
TestStats.restartCount + 1,
|
||||
completedEvent.testDuration +
|
||||
completedEvent.incompleteTestSeconds -
|
||||
completedEvent.afkDuration
|
||||
);
|
||||
}
|
||||
|
||||
DB.saveLocalResult(completedEvent);
|
||||
DB.updateLocalStats(
|
||||
TestStats.restartCount + 1,
|
||||
completedEvent.testDuration +
|
||||
completedEvent.incompleteTestSeconds -
|
||||
completedEvent.afkDuration
|
||||
);
|
||||
|
||||
AnalyticsController.log("testCompleted");
|
||||
|
||||
if (response?.data?.isPb) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue