File tree Expand file tree Collapse file tree 4 files changed +23
-13
lines changed Expand file tree Collapse file tree 4 files changed +23
-13
lines changed Original file line number Diff line number Diff line change @@ -7,15 +7,16 @@ require('crash-reporter').start();
7
7
var Menu = require ( 'menu' ) ;
8
8
var Tray = require ( 'tray' ) ;
9
9
var BrowserWindow = require ( 'browser-window' ) ;
10
- var AutoLaunch = require ( 'auto-launch' )
11
- , start = new AutoLaunch ( {
12
- name : 'Gitify' ,
13
- path : process . execPath . match ( / .* ?\. a p p / ) [ 0 ]
14
- } ) ;
10
+ var AutoLaunch = require ( 'auto-launch' ) ;
15
11
16
12
var iconIdle = path . join ( __dirname , 'images' , 'tray-idleTemplate.png' ) ;
17
13
var iconActive = path . join ( __dirname , 'images' , 'tray-active.png' ) ;
18
14
15
+ var autoStart = new AutoLaunch ( {
16
+ name : 'Gitify' ,
17
+ path : process . execPath . match ( / .* ?\. a p p / ) [ 0 ]
18
+ } ) ;
19
+
19
20
app . on ( 'ready' , function ( ) {
20
21
var appIcon = new Tray ( iconIdle ) ;
21
22
initWindow ( ) ;
@@ -100,11 +101,11 @@ app.on('ready', function(){
100
101
} ) ;
101
102
102
103
ipc . on ( 'startup-enable' , function ( ) {
103
- start . enable ( ) ;
104
+ autoStart . enable ( ) ;
104
105
} ) ;
105
106
106
107
ipc . on ( 'startup-disable' , function ( ) {
107
- start . disable ( ) ;
108
+ autoStart . disable ( ) ;
108
109
} ) ;
109
110
110
111
ipc . on ( 'app-quit' , function ( ) {
Original file line number Diff line number Diff line change 120
120
},
121
121
"homepage" : " https://github.com/ekonstantinidis/gitify" ,
122
122
"dependencies" : {
123
- "auto-launch" : " ^ 0.1.18" ,
123
+ "auto-launch" : " = 0.1.18" ,
124
124
"bootstrap" : " =3.3.4" ,
125
125
"browserify" : " =10.2.1" ,
126
126
"font-awesome" : " =4.3.0" ,
145
145
"grunt-contrib-copy" : " =0.8.0" ,
146
146
"grunt-contrib-less" : " =1.0.1" ,
147
147
"grunt-contrib-watch" : " =0.6.1" ,
148
- "jest-cli" : " =0.4.12 " ,
148
+ "jest-cli" : " =0.4.17 " ,
149
149
"jscs" : " ^1.13.1" ,
150
150
"jshint-stylish" : " =1.0.2" ,
151
151
"jsxhint" : " =0.15.0" ,
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ describe('Tests for SettingsStore', function () {
17
17
return {
18
18
sendChannel : function ( ) {
19
19
return ;
20
+ } ,
21
+ send : function ( ) {
22
+ return ;
20
23
}
21
24
} ;
22
25
} ;
@@ -39,21 +42,26 @@ describe('Tests for SettingsStore', function () {
39
42
it ( 'should get the settings' , function ( ) {
40
43
41
44
spyOn ( SettingsStore , 'trigger' ) ;
42
-
43
45
expect ( SettingsStore . getSettings ( ) . participating ) . toBe ( false ) ;
44
46
45
47
} ) ;
46
48
47
49
it ( 'should set a setting' , function ( ) {
48
50
49
51
spyOn ( SettingsStore , 'trigger' ) ;
50
-
51
52
SettingsStore . onSetSetting ( 'participating' , true ) ;
52
-
53
53
expect ( SettingsStore . getSettings ( ) . participating ) . toBe ( true ) ;
54
54
55
55
} ) ;
56
56
57
+ it ( 'should set the setting: openAtStartup ' , function ( ) {
58
+
59
+ spyOn ( SettingsStore , 'trigger' ) ;
60
+ SettingsStore . onSetSetting ( 'openAtStartup' , true ) ;
61
+ expect ( SettingsStore . getSettings ( ) . openAtStartup ) . toBe ( true ) ;
62
+
63
+ } ) ;
64
+
57
65
} ) ;
58
66
59
67
describe ( 'Tests for SettingsStore' , function ( ) {
Original file line number Diff line number Diff line change
1
+ var ipc = window . require ( 'ipc' ) ;
2
+
1
3
var Reflux = require ( 'reflux' ) ;
2
4
var Actions = require ( '../actions/actions' ) ;
3
5
@@ -51,7 +53,6 @@ var SettingsStore = Reflux.createStore({
51
53
} ,
52
54
53
55
handleStartup : function ( value ) {
54
- var ipc = window . require ( 'ipc' ) ;
55
56
var method = ( value ) ? 'startup-enable' : 'startup-disable' ;
56
57
ipc . send ( method ) ;
57
58
}
You can’t perform that action at this time.
0 commit comments