diff --git a/backend/dao/user.js b/backend/dao/user.js index 86e4ebcef..d5365500b 100644 --- a/backend/dao/user.js +++ b/backend/dao/user.js @@ -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 = []; diff --git a/src/js/db.js b/src/js/db.js index 7da08d785..755da6ca8 100644 --- a/src/js/db.js +++ b/src/js/db.js @@ -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] = [ {