Skip to content

Commit

Permalink
feat: move auto-launch and use openAtLogin
Browse files Browse the repository at this point in the history
  • Loading branch information
DG-Wangtao committed Mar 6, 2020
1 parent 0983166 commit 7961676
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 87 deletions.
137 changes: 57 additions & 80 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"author": "GitHub",
"license": "CC0-1.0",
"devDependencies": {
"electron": "^7.1.1",
"electron": "^7.1.14",
"electron-builder": "^22.1.0",
"eslint": "^6.7.1"
},
Expand All @@ -55,7 +55,6 @@
},
"homepage": "https://github.com/WaylandWong/timestamp-convert",
"dependencies": {
"auto-launch": "^5.0.5",
"update-electron-app": "^1.5.0",
"uuid": "^3.3.3"
}
Expand Down
9 changes: 4 additions & 5 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ const path = require('path');
const uuidv1 = require('uuid/v1');
const uuidv4 = require('uuid/v4');

var AutoLaunch = require('auto-launch');
var autoLaunch = new AutoLaunch({
name: 'timestamp-convert',
});
autoLaunch.enable();
app.setLoginItemSettings({
openAtLogin: true, // Boolean 在登录时启动应用
openAsHidden: true, // Boolean (可选) mac 表示以隐藏的方式启动应用。~~~~
})

// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
Expand Down

0 comments on commit 7961676

Please sign in to comment.