Merge pull request #199 from resin-io/misc/analytics-restart

Move "Restart" event log to FinishController
This commit is contained in:
Juan Cruz Viotti 2016-03-10 12:49:42 -04:00
commit ee2fd2a91c

View File

@ -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');
};
});