mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-10-27 17:27:32 +08:00
completely fixed result saving for new users
This commit is contained in:
parent
8476a7c594
commit
ce505c9b8a
1 changed files with 18 additions and 6 deletions
|
|
@ -434,9 +434,15 @@ export async function signInWithGoogle() {
|
|||
);
|
||||
|
||||
if (resultsSaveResponse.status === 200) {
|
||||
const snapshot = DB.getSnapshot();
|
||||
snapshot.results.push(TestLogic.notSignedInLastResult);
|
||||
DB.setSnapshot(snapshot);
|
||||
const result = TestLogic.notSignedInLastResult;
|
||||
DB.saveLocalResult(result);
|
||||
DB.updateLocalStats({
|
||||
time:
|
||||
result.testDuration +
|
||||
result.incompleteTestSeconds -
|
||||
result.afkDuration,
|
||||
started: 1,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -643,9 +649,15 @@ async function signUp() {
|
|||
const response = await Ape.results.save(TestLogic.notSignedInLastResult);
|
||||
|
||||
if (response.status === 200) {
|
||||
const snapshot = DB.getSnapshot();
|
||||
snapshot.results.push(TestLogic.notSignedInLastResult);
|
||||
DB.setSnapshot(snapshot);
|
||||
const result = TestLogic.notSignedInLastResult;
|
||||
DB.saveLocalResult(result);
|
||||
DB.updateLocalStats({
|
||||
time:
|
||||
result.testDuration +
|
||||
result.incompleteTestSeconds -
|
||||
result.afkDuration,
|
||||
started: 1,
|
||||
});
|
||||
}
|
||||
}
|
||||
PageController.change("account");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue