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 } })