From e429a87d5a977f96539d119767403bd8f268f603 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Thu, 10 Mar 2016 12:36:34 -0400 Subject: [PATCH] Move "Restart" event log to FinishController --- lib/browser/app.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/browser/app.js b/lib/browser/app.js index 531331f2..c8283ef2 100644 --- a/lib/browser/app.js +++ b/lib/browser/app.js @@ -88,8 +88,6 @@ app.controller('AppController', function( this.writer = ImageWriterService; this.scanner = DriveScannerService; - AnalyticsService.logEvent('Restart'); - NotifierService.subscribe($scope, 'image-writer:state', function(state) { AnalyticsService.log(`Progress: ${state.progress}% at ${state.speed} MB/s`); @@ -210,12 +208,19 @@ app.controller('NavigationController', function($state) { this.open = shell.openExternal; }); -app.controller('FinishController', function($state, SelectionStateService, SettingsService, ImageWriterService) { +app.controller('FinishController', function( + $state, + SelectionStateService, + SettingsService, + ImageWriterService, + AnalyticsService +) { this.settings = SettingsService.data; this.restart = function(options) { SelectionStateService.clear(options); ImageWriterService.resetState(); + AnalyticsService.logEvent('Restart', options); $state.go('main'); }; });