mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 13:01:10 +08:00
fixed tag pbs not working as intended
This commit is contained in:
parent
edd453bfef
commit
eb5137e11c
2 changed files with 12 additions and 3 deletions
|
@ -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 = [];
|
||||
|
|
|
@ -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] = [
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue