mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-03-10 21:53:13 +08:00
fixed a bug that would cause the pb object to not be saved correctly
This commit is contained in:
parent
50c441bee5
commit
f31aa80102
2 changed files with 8 additions and 1 deletions
|
@ -267,6 +267,9 @@ function checkIfPB(uid, obj) {
|
|||
let toUpdate = false;
|
||||
let found = false;
|
||||
try {
|
||||
if (pbs[obj.mode][obj.mode2] === undefined) {
|
||||
pbs[obj.mode][obj.mode2] = [];
|
||||
}
|
||||
pbs[obj.mode][obj.mode2].forEach((pb) => {
|
||||
if (
|
||||
pb.punctuation === obj.punctuation &&
|
||||
|
@ -356,7 +359,8 @@ exports.testCompleted = functions.https.onCall((request, response) => {
|
|||
return -1;
|
||||
}
|
||||
|
||||
db.collection("users")
|
||||
return db
|
||||
.collection("users")
|
||||
.doc(request.uid)
|
||||
.get()
|
||||
.then((ret) => {
|
||||
|
|
|
@ -142,6 +142,9 @@ async function db_saveLocalPB(
|
|||
function cont() {
|
||||
try {
|
||||
let found = false;
|
||||
if (dbSnapshot.personalBests[mode][mode2] === undefined) {
|
||||
dbSnapshot.personalBests[mode][mode2] = [];
|
||||
}
|
||||
dbSnapshot.personalBests[mode][mode2].forEach((pb) => {
|
||||
if (
|
||||
pb.punctuation == punctuation &&
|
||||
|
|
Loading…
Reference in a new issue