@@ -25,6 +25,12 @@ let gtt = new events.EventEmitter(),
2525gtt . _app = app ;
2626gtt . _version = '0.2.1' ;
2727gtt . _config = new Config ( __dirname ) ;
28+
29+ if ( gtt . _config . get ( 'error-reporting' ) ) {
30+ var Raven = require ( 'raven' ) ;
31+ Raven . config ( 'https://[email protected] /1218774' ) . install ( ) ; 32+ }
33+
2834gtt . _api = new Base ( gtt . _config ) ;
2935gtt . _tasks = new Tasks ( gtt . _config ) ;
3036gtt . _paused = false ;
@@ -206,10 +212,7 @@ gtt.setTray = () => {
206212
207213 if ( gtt . _platform == 'linux' ) {
208214 let contextMenu = Menu . buildFromTemplate ( [
209- { label : 'Open GTT' , click : ( d1 , d2 , d3 ) => {
210- console . log ( d1 , d2 , d3 ) ;
211- gtt . toggleTrayWindow
212- } } ,
215+ { label : 'Open GTT' , click : gtt . toggleTrayWindow } ,
213216 { label : 'Quit' , click : app . quit }
214217 ] ) ;
215218 trayIcon . setContextMenu ( contextMenu ) ;
@@ -390,6 +393,9 @@ gtt._dump = (msg) => {
390393} ;
391394
392395gtt . _send = ( key , val ) => {
396+ if ( debug ) {
397+ gtt . _dump ( `ipc main send: ${ key } , ${ val } ` ) ;
398+ }
393399 trayWindow . webContents . send ( key , val ) ;
394400} ;
395401
@@ -416,11 +422,12 @@ gtt._watchers.frames = {
416422 gtt . _dump ( 'Added frames watcher' ) ;
417423 this . watcher = chokidar
418424 . watch ( path . join ( gtt . _config . frameDir , '*.json' ) , { ignoreInitial : true } )
419- . on ( 'all' , ( ) => {
425+ . on ( 'raw' , ( event , path ) => {
426+ gtt . _dump ( `"${ path } " changed.` ) ;
420427 if ( this . timeout ) clearTimeout ( this . timeout ) ;
421428 this . timeout = setTimeout ( ( ) => {
422429 gtt . log ( ) . then ( data => gtt . _send ( 'gtt-log' , data ) ) ;
423- gtt . status ( ) . then ( status => gtt . _send ( 'gtt-status' , status ) )
430+ gtt . status ( ) . then ( status => gtt . _send ( 'gtt-status' , status ) ) ;
424431 } , 100 ) ;
425432 } ) ;
426433 } ,
0 commit comments