From 0abb264fa6da43a6b48b22226bd4ccfda38386f9 Mon Sep 17 00:00:00 2001 From: Matias Pando Date: Thu, 13 Nov 2014 12:55:45 -0300 Subject: [PATCH] Importing a profile also logs in --- js/controllers/importProfile.js | 14 +++++++++++--- js/services/identityService.js | 1 - 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/js/controllers/importProfile.js b/js/controllers/importProfile.js index b0a577309..56f91abb7 100644 --- a/js/controllers/importProfile.js +++ b/js/controllers/importProfile.js @@ -1,7 +1,7 @@ 'use strict'; angular.module('copayApp.controllers').controller('ImportProfileController', - function($scope, $rootScope, $location, controllerUtils, notification, isMobile, pluginManager) { + function($scope, $rootScope, $location, controllerUtils, notification, isMobile, pluginManager, identityService) { controllerUtils.redirIfLogged(); $scope.title = 'Import a backup'; @@ -30,8 +30,16 @@ angular.module('copayApp.controllers').controller('ImportProfileController', if (err && !iden) { $scope.error = (err.toString() || '').match('BADSTR') ? 'Bad password or corrupt profile file' : 'Unknown error'; } else { - notification.info('Success', 'Profile imported successfully'); - $location.path('/'); + //simulate an angular form + var data = { + email: { + $modelValue: iden.email + }, + password: { + $modelValue: iden.password + } + } + identityService.open($scope, data); } }); }; diff --git a/js/services/identityService.js b/js/services/identityService.js index 12903108e..6c019f5d9 100644 --- a/js/services/identityService.js +++ b/js/services/identityService.js @@ -43,7 +43,6 @@ angular.module('copayApp.services') $timeout(function() { $rootScope.$digest() }, 1); - return; } var walletOptions = {