mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-02-04 21:09:18 +08:00
fixed a bug that was added when changing the cookie functions
This commit is contained in:
parent
5fbc59270c
commit
4286e698f3
1 changed files with 11 additions and 2 deletions
|
@ -149,8 +149,12 @@ function loadConfigFromCookie() {
|
|||
console.log("loading cookie config");
|
||||
// let newConfig = $.cookie("config");
|
||||
let newConfig = getCookie("config");
|
||||
if (newConfig !== undefined) {
|
||||
newConfig = JSON.parse(newConfig);
|
||||
if (newConfig !== undefined && newConfig !== "") {
|
||||
try {
|
||||
newConfig = JSON.parse(newConfig);
|
||||
} catch (e) {
|
||||
newConfig = {};
|
||||
}
|
||||
applyConfig(newConfig);
|
||||
console.log("applying cookie config");
|
||||
cookieConfig = newConfig;
|
||||
|
@ -292,6 +296,11 @@ function loadActiveTagsFromCookie() {
|
|||
// let newTags = $.cookie("activeTags");
|
||||
let newTags = getCookie("activeTags");
|
||||
if (newTags !== undefined && newTags !== "") {
|
||||
try {
|
||||
newTags = JSON.parse(newTags);
|
||||
} catch (e) {
|
||||
newTags = {};
|
||||
}
|
||||
newTags = JSON.parse(newTags);
|
||||
newTags.forEach((ntag) => {
|
||||
toggleTag(ntag, true);
|
||||
|
|
Loading…
Reference in a new issue