diff --git a/src/app.js b/src/app.js index dd1a28c..3594431 100644 --- a/src/app.js +++ b/src/app.js @@ -445,8 +445,8 @@ class App{ }); } - get times() {return localStorage.times || 0;} - set times(v) {localStorage.times = parseInt(v) || 0}; + get times() {return JSON.parse(localStorage.times||'') || 0;} + set times(v) {localStorage.times = JSON.stringify(parseInt(v) || 0)}; } diff --git a/src/life.js b/src/life.js index 6420d08..85b0234 100644 --- a/src/life.js +++ b/src/life.js @@ -99,11 +99,11 @@ class Life { } talentRandom() { - return this.#talent.talentRandom(localStorage.extendTalent); + return this.#talent.talentRandom(JSON.parse(localStorage.extendTalent||'')); } talentExtend(talentId) { - localStorage.extendTalent = talentId; + localStorage.extendTalent = JSON.stringify(talentId); } getRecord() {