From 26d959dcc01d9e0734997aff027fa2937d162a86 Mon Sep 17 00:00:00 2001 From: xiaojunnuo Date: Thu, 3 Dec 2020 16:24:17 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20pac=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/gui/src/bridge/api/backend.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/gui/src/bridge/api/backend.js b/packages/gui/src/bridge/api/backend.js index 727bb1c..b715a63 100644 --- a/packages/gui/src/bridge/api/backend.js +++ b/packages/gui/src/bridge/api/backend.js @@ -42,10 +42,14 @@ const localApi = { load () { const settingPath = _getSettingsPath() if (!fs.existsSync(settingPath)) { - return {} + this.save({ overwall: true }) } const file = fs.readFileSync(settingPath) const setting = JSON5.parse(file.toString()) + if (setting && setting.installTime == null) { + setting.installTime = new Date().getTime() + this.save(setting) + } return setting || {} }, save (setting = {}) {