File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed
src/extensions/default/Git/src Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -419,10 +419,17 @@ define(function (require, exports) {
419419 $ ( window ) . focus ( refreshOnFocusChange ) ;
420420
421421 // Event handlers
422+ let projectSwitched = true ;
423+ EventEmitter . on ( Events . BRACKETS_PROJECT_CHANGE , function ( ) {
424+ // pressing refresh button will raise GIT_ENABLED event and we only want one enabled metric
425+ // per project open.
426+ projectSwitched = true ;
427+ } ) ;
422428 EventEmitter . on ( Events . GIT_ENABLED , function ( ) {
423429 _enableAllCommands ( true ) ;
424430 gitEnabled = true ;
425- Metrics . countEvent ( Metrics . EVENT_TYPE . GIT , 'enabled' , "project" ) ;
431+ projectSwitched && Metrics . countEvent ( Metrics . EVENT_TYPE . GIT , 'enabled' , "project" ) ;
432+ projectSwitched = false ;
426433 } ) ;
427434 EventEmitter . on ( Events . GIT_DISABLED , function ( ) {
428435 _enableAllCommands ( false ) ;
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ define(function (require, exports) {
8585 . then ( function ( ) {
8686 fillBranches ( config , $dialog ) ;
8787 } ) . catch ( function ( err ) {
88- throw ErrorHandler . showError ( err , Strings . ERROR_FETCH_REMOTE ) ;
88+ ErrorHandler . showError ( err , Strings . ERROR_FETCH_REMOTE ) ;
8989 } ) ;
9090 } ) ;
9191 fillBranches ( config , $dialog ) ;
You can’t perform that action at this time.
0 commit comments