From 17261cd567739dde338f2d882687424c9d88ad16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Fri, 18 Dec 2020 14:52:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=B8=BB=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=E4=B8=8E=E5=B0=8F=E7=AA=97=E5=8F=A3=E6=95=B0=E6=8D=AE=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E7=9A=84bug;=E5=A2=9E=E5=8A=A0=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E7=9A=84debug=E6=9A=97=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- src/js/app.js | 5 +++++ src/js/float.js | 15 ++++++++------- src/main.js | 5 +++++ 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index aaa08b0..ea8adad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "io.yutent.gaystat", - "version": "2.1.1", + "version": "2.1.2", "description": "搞基数据", "main": "src/main.js", "scripts": { diff --git a/src/js/app.js b/src/js/app.js index 2d442f4..9eff464 100644 --- a/src/js/app.js +++ b/src/js/app.js @@ -153,6 +153,11 @@ Anot({ return } + if (code === 'debug') { + this.input = '' + return app.dispatch('devtools') + } + if (code.length < 6) { return } diff --git a/src/js/float.js b/src/js/float.js index 49f375c..fb18ad8 100644 --- a/src/js/float.js +++ b/src/js/float.js @@ -29,13 +29,14 @@ Anot({ var time = +Anot.ss('last_update') || 0 var now = Date.now() - // 如果离上次更新超过15分钟, 则自动更新 - if (now - time > 15 * 60 * 1000) { - this.updateGays() - Anot.ss('last_update', now) - } else { - this.reloadGays() - } + this.reloadGays() + setTimeout(() => { + // 如果离上次更新超过15分钟, 则自动更新 + if (now - time > 15 * 60 * 1000) { + this.updateGays() + Anot.ss('last_update', now) + } + }, 500) }) }, methods: { diff --git a/src/main.js b/src/main.js index 1666e3b..6f1763f 100644 --- a/src/main.js +++ b/src/main.js @@ -144,5 +144,10 @@ ipcMain.on('app', (ev, conn) => { app.__main__.webContents.send('app', { type: 'data-reload', data: null }) ev.returnValue = true break + + case 'devtools': + app.__main__.openDevTools() + ev.returnValue = true + break } })