File tree Expand file tree Collapse file tree 1 file changed +25
-1
lines changed
src/renderer/components/SettingsWindow Expand file tree Collapse file tree 1 file changed +25
-1
lines changed Original file line number Diff line number Diff line change 8
8
9
9
<div class =" form-item" >
10
10
<label >
11
- <input type =" checkbox" v-model =" data.startupWithOS" disabled > <span >Startup with windows</span >
11
+ <input type =" checkbox" v-model =" data.startupWithOS" > <span >Startup with windows</span >
12
12
</label >
13
13
</div >
14
14
@@ -26,6 +26,7 @@ import { remote } from 'electron'
26
26
import Window from ' @/components/Window'
27
27
28
28
const windowManager = remote .require (' electron-window-manager' )
29
+ const app = remote .require (' electron' ).app
29
30
30
31
export default {
31
32
name: ' settings-window' ,
@@ -42,6 +43,13 @@ export default {
42
43
save () {
43
44
this .$store .dispatch (' UPDATE_SETTINGS' , this .data )
44
45
46
+ app .setLoginItemSettings ({
47
+ ... {
48
+ openAtLogin: this .data .startupWithOS
49
+ },
50
+ ... this .loginItemSettings
51
+ })
52
+
45
53
windowManager .closeCurrent ()
46
54
}
47
55
},
@@ -50,6 +58,22 @@ export default {
50
58
data () {
51
59
return this .$store .state .Settings .settings
52
60
}
61
+ },
62
+
63
+ data () {
64
+ return {
65
+ loginItemSettings: {
66
+ args: [
67
+ ' --systray'
68
+ ]
69
+ }
70
+ }
71
+ },
72
+
73
+ mounted () {
74
+ const settings = app .getLoginItemSettings (this .loginItemSettings )
75
+
76
+ this .data .startupWithOS = settings .openAtLogin
53
77
}
54
78
}
55
79
</script >
You can’t perform that action at this time.
0 commit comments