fixed tag pbs not working as intended

This commit is contained in:
Miodec 2021-07-09 21:41:33 +01:00
parent edd453bfef
commit eb5137e11c
2 changed files with 12 additions and 3 deletions

View file

@ -189,17 +189,24 @@ class UsersDAO {
rawWpm,
wpm,
tags,
funbox,
} = result;
if (funbox !== "none" && funbox !== "plus_one" && funbox !== "plus_two") {
return [];
}
if (mode === "quote") {
return [];
}
let tagsToCheck = [];
user.tags.forEach((tag) => {
if (tags.includes(tag._id)) {
tagsToCheck.push(tag);
}
tags.forEach((resultTag) => {
if (resultTag == tag._id) {
tagsToCheck.push(tag);
}
});
});
let ret = [];

View file

@ -350,6 +350,7 @@ export async function saveLocalPB(
}
} catch (e) {
//that mode or mode2 is not found
dbSnapshot.personalBests = {};
dbSnapshot.personalBests[mode] = {};
dbSnapshot.personalBests[mode][mode2] = [
{
@ -456,6 +457,7 @@ export async function saveLocalTagPB(
}
} catch (e) {
//that mode or mode2 is not found
filteredtag.personalBests = {};
filteredtag.personalBests[mode] = {};
filteredtag.personalBests[mode][mode2] = [
{