mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-10 05:35:05 +08:00
saving the last result when a user signs up
This commit is contained in:
parent
c94dcafd20
commit
05b7b8c37f
2 changed files with 11 additions and 0 deletions
public/js
|
@ -154,6 +154,15 @@ function signUp() {
|
|||
personalBests: {},
|
||||
tags: [],
|
||||
};
|
||||
if (notSignedInLastResult !== null) {
|
||||
notSignedInLastResult.uid = usr.uid;
|
||||
testCompleted({
|
||||
uid: usr.uid,
|
||||
obj: notSignedInLastResult,
|
||||
});
|
||||
dbSnapshot.results.push(notSignedInLastResult);
|
||||
config.resultFilters = defaultAccountFilters;
|
||||
}
|
||||
changePage("account");
|
||||
})
|
||||
.catch(function (error) {
|
||||
|
|
|
@ -36,6 +36,7 @@ let focusState = false;
|
|||
let activeFunBox = "none";
|
||||
let manualRestart = false;
|
||||
let bailout = false;
|
||||
let notSignedInLastResult = null;
|
||||
|
||||
let themeColors = {
|
||||
bg: "#323437",
|
||||
|
@ -1947,6 +1948,7 @@ function showResult(difficultyFailed = false) {
|
|||
} catch (e) {
|
||||
console.log("Analytics unavailable");
|
||||
}
|
||||
notSignedInLastResult = completedEvent;
|
||||
|
||||
// showNotification("Sign in to save your result",3000);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue