refactor: autostart
parent
a3c4b2a206
commit
e6d4ae6753
|
@ -6,9 +6,9 @@ import { createProtocol } from 'vue-cli-plugin-electron-builder/lib'
|
||||||
import backend from './bridge/backend'
|
import backend from './bridge/backend'
|
||||||
import DevSidecar from '@docmirror/dev-sidecar'
|
import DevSidecar from '@docmirror/dev-sidecar'
|
||||||
import log from './utils/util.log'
|
import log from './utils/util.log'
|
||||||
|
import minimist from 'minimist'
|
||||||
// eslint-disable-next-line no-unused-vars
|
// eslint-disable-next-line no-unused-vars
|
||||||
const isMac = process.platform === 'darwin'
|
const isMac = process.platform === 'darwin'
|
||||||
|
|
||||||
// import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'
|
// import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'
|
||||||
const isDevelopment = process.env.NODE_ENV !== 'production'
|
const isDevelopment = process.env.NODE_ENV !== 'production'
|
||||||
|
|
||||||
|
@ -113,6 +113,14 @@ function createWindow () {
|
||||||
win.hide()
|
win.hide()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if (process.argv) {
|
||||||
|
const args = minimist(process.argv)
|
||||||
|
console.log('start args', args)
|
||||||
|
if (args.hideWindow) {
|
||||||
|
win.hide()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function beforeQuit () {
|
async function beforeQuit () {
|
||||||
|
|
|
@ -13,7 +13,9 @@ export default {
|
||||||
app.setLoginItemSettings({
|
app.setLoginItemSettings({
|
||||||
openAtLogin: true,
|
openAtLogin: true,
|
||||||
path: ex,
|
path: ex,
|
||||||
args: []
|
args: [
|
||||||
|
'--hideWindow', '"true"'
|
||||||
|
]
|
||||||
})
|
})
|
||||||
event.sender.send('auto-start', { key: 'enabled', value: true })
|
event.sender.send('auto-start', { key: 'enabled', value: true })
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue