Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
hacdias committed Nov 19, 2021
1 parent 73c92e8 commit 8d1adc1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/webui/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,14 @@ module.exports = async function (ctx) {
window.once('close', () => {
const myself = window
window = null
dock.hide() // NOTE: not working?
myself.close()
})

await new Promise(resolve => {
window.once('ready-to-show', () => {
logger.info('[web ui] window ready')

if (store.get(CONFIG_KEY)) {
launchWindow('/').then(resolve)
} else {
resolve()
}
launchWindow('/').then(resolve)
})

updateLanguage()
Expand Down Expand Up @@ -203,7 +199,11 @@ module.exports = async function (ctx) {
callback({ responseHeaders })
})

return getWindow()
return async () => {
if (store.get(CONFIG_KEY)) {
await launchWindow('/')
}
}
}

module.exports.CONFIG_KEY = CONFIG_KEY

0 comments on commit 8d1adc1

Please sign in to comment.