@@ -10,6 +10,7 @@ const chokidar = require('chokidar');
1010const os = require ( 'os' ) ;
1111
1212const moment = require ( 'moment' ) ;
13+ var log = require ( 'electron-log' ) ;
1314
1415let gtt = new events . EventEmitter ( ) ,
1516 trayIcon = null ,
@@ -204,7 +205,10 @@ gtt.setTray = () => {
204205
205206 if ( gtt . _platform == 'linux' ) {
206207 let contextMenu = Menu . buildFromTemplate ( [
207- { label : 'Open GTT' , click : gtt . toggleTrayWindow } ,
208+ { label : 'Open GTT' , click : ( d1 , d2 , d3 ) => {
209+ console . log ( d1 , d2 , d3 ) ;
210+ gtt . toggleTrayWindow
211+ } } ,
208212 { label : 'Quit' , click : app . quit }
209213 ] ) ;
210214 trayIcon . setContextMenu ( contextMenu ) ;
@@ -381,7 +385,7 @@ gtt.cache = {
381385 * @private
382386 */
383387gtt . _dump = ( msg ) => {
384- if ( debug ) console . log ( ` ${ moment ( ) . format ( 'YYYY-MM-DD HH:mm:ss.SSS' ) } GTT ${ msg } ` )
388+ log . info ( msg ) ;
385389} ;
386390
387391gtt . _send = ( key , val ) => {
@@ -430,12 +434,12 @@ gtt._handleError = error => {
430434 if ( error . statusCode === 401 && ! gtt . _unauthorized ) {
431435 gtt . _unauthorized = true ;
432436 if ( dialog . showMessageBox ( null , {
433- type : "warning" ,
434- title : "Unauthorized" ,
435- message : "Cannot connect to GitLab: unauthorized." ,
436- detail : "If this is the first time you start gtt, open the preferences and add your GitLab API token." ,
437- buttons : [ "Go to preferences now" , "I'll do it later" ]
438- } ) === 0 ) gtt . openSettingsWindow ( ) ;
437+ type : "warning" ,
438+ title : "Unauthorized" ,
439+ message : "Cannot connect to GitLab: unauthorized." ,
440+ detail : "If this is the first time you start gtt, open the preferences and add your GitLab API token." ,
441+ buttons : [ "Go to preferences now" , "I'll do it later" ]
442+ } ) === 0 ) gtt . openSettingsWindow ( ) ;
439443 }
440444} ;
441445
0 commit comments