修复主窗口与小窗口数据同步的bug;增加隐藏的debug暗号

master
宇天 2020-12-18 14:52:26 +08:00
parent e5a44fc917
commit 17261cd567
4 changed files with 19 additions and 8 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "io.yutent.gaystat", "name": "io.yutent.gaystat",
"version": "2.1.1", "version": "2.1.2",
"description": "搞基数据", "description": "搞基数据",
"main": "src/main.js", "main": "src/main.js",
"scripts": { "scripts": {

View File

@ -153,6 +153,11 @@ Anot({
return return
} }
if (code === 'debug') {
this.input = ''
return app.dispatch('devtools')
}
if (code.length < 6) { if (code.length < 6) {
return return
} }

View File

@ -29,13 +29,14 @@ Anot({
var time = +Anot.ss('last_update') || 0 var time = +Anot.ss('last_update') || 0
var now = Date.now() var now = Date.now()
// 如果离上次更新超过15分钟, 则自动更新 this.reloadGays()
if (now - time > 15 * 60 * 1000) { setTimeout(() => {
this.updateGays() // 如果离上次更新超过15分钟, 则自动更新
Anot.ss('last_update', now) if (now - time > 15 * 60 * 1000) {
} else { this.updateGays()
this.reloadGays() Anot.ss('last_update', now)
} }
}, 500)
}) })
}, },
methods: { methods: {

View File

@ -144,5 +144,10 @@ ipcMain.on('app', (ev, conn) => {
app.__main__.webContents.send('app', { type: 'data-reload', data: null }) app.__main__.webContents.send('app', { type: 'data-reload', data: null })
ev.returnValue = true ev.returnValue = true
break break
case 'devtools':
app.__main__.openDevTools()
ev.returnValue = true
break
} }
}) })