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();
77var Menu = require ( 'menu' ) ;
88var Tray = require ( 'tray' ) ;
99var 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' ) ;
1511
1612var iconIdle = path . join ( __dirname , 'images' , 'tray-idleTemplate.png' ) ;
1713var iconActive = path . join ( __dirname , 'images' , 'tray-active.png' ) ;
1814
15+ var autoStart = new AutoLaunch ( {
16+ name : 'Gitify' ,
17+ path : process . execPath . match ( / .* ?\. a p p / ) [ 0 ]
18+ } ) ;
19+
1920app . on ( 'ready' , function ( ) {
2021 var appIcon = new Tray ( iconIdle ) ;
2122 initWindow ( ) ;
@@ -100,11 +101,11 @@ app.on('ready', function(){
100101 } ) ;
101102
102103 ipc . on ( 'startup-enable' , function ( ) {
103- start . enable ( ) ;
104+ autoStart . enable ( ) ;
104105 } ) ;
105106
106107 ipc . on ( 'startup-disable' , function ( ) {
107- start . disable ( ) ;
108+ autoStart . disable ( ) ;
108109 } ) ;
109110
110111 ipc . on ( 'app-quit' , function ( ) {
Original file line number Diff line number Diff line change 120120 },
121121 "homepage" : " https://github.com/ekonstantinidis/gitify" ,
122122 "dependencies" : {
123- "auto-launch" : " ^ 0.1.18" ,
123+ "auto-launch" : " = 0.1.18" ,
124124 "bootstrap" : " =3.3.4" ,
125125 "browserify" : " =10.2.1" ,
126126 "font-awesome" : " =4.3.0" ,
145145 "grunt-contrib-copy" : " =0.8.0" ,
146146 "grunt-contrib-less" : " =1.0.1" ,
147147 "grunt-contrib-watch" : " =0.6.1" ,
148- "jest-cli" : " =0.4.12 " ,
148+ "jest-cli" : " =0.4.17 " ,
149149 "jscs" : " ^1.13.1" ,
150150 "jshint-stylish" : " =1.0.2" ,
151151 "jsxhint" : " =0.15.0" ,
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ describe('Tests for SettingsStore', function () {
1717 return {
1818 sendChannel : function ( ) {
1919 return ;
20+ } ,
21+ send : function ( ) {
22+ return ;
2023 }
2124 } ;
2225 } ;
@@ -39,21 +42,26 @@ describe('Tests for SettingsStore', function () {
3942 it ( 'should get the settings' , function ( ) {
4043
4144 spyOn ( SettingsStore , 'trigger' ) ;
42-
4345 expect ( SettingsStore . getSettings ( ) . participating ) . toBe ( false ) ;
4446
4547 } ) ;
4648
4749 it ( 'should set a setting' , function ( ) {
4850
4951 spyOn ( SettingsStore , 'trigger' ) ;
50-
5152 SettingsStore . onSetSetting ( 'participating' , true ) ;
52-
5353 expect ( SettingsStore . getSettings ( ) . participating ) . toBe ( true ) ;
5454
5555 } ) ;
5656
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+
5765} ) ;
5866
5967describe ( 'Tests for SettingsStore' , function ( ) {
Original file line number Diff line number Diff line change 1+ var ipc = window . require ( 'ipc' ) ;
2+
13var Reflux = require ( 'reflux' ) ;
24var Actions = require ( '../actions/actions' ) ;
35
@@ -51,7 +53,6 @@ var SettingsStore = Reflux.createStore({
5153 } ,
5254
5355 handleStartup : function ( value ) {
54- var ipc = window . require ( 'ipc' ) ;
5556 var method = ( value ) ? 'startup-enable' : 'startup-disable' ;
5657 ipc . send ( method ) ;
5758 }
You can’t perform that action at this time.
0 commit comments