From a3cc5821f745d7c6d0afb1fdf72cde42965d8ae0 Mon Sep 17 00:00:00 2001 From: Vick Scarlet Date: Fri, 20 Aug 2021 11:34:54 +0800 Subject: [PATCH] bug fix --- src/app.js | 2 +- src/life.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app.js b/src/app.js index 3594431..8671eae 100644 --- a/src/app.js +++ b/src/app.js @@ -445,7 +445,7 @@ class App{ }); } - get times() {return JSON.parse(localStorage.times||'') || 0;} + get times() {return JSON.parse(localStorage.times||'0') || 0;} set times(v) {localStorage.times = JSON.stringify(parseInt(v) || 0)}; } diff --git a/src/life.js b/src/life.js index 2ccb3a6..291e015 100644 --- a/src/life.js +++ b/src/life.js @@ -99,7 +99,7 @@ class Life { } talentRandom() { - return this.#talent.talentRandom(JSON.parse(localStorage.extendTalent||'')); + return this.#talent.talentRandom(JSON.parse(localStorage.extendTalent||'null')); } talentExtend(talentId) {