Merge pull request #1801 from matiaspando/feature/importAndLogin

Importing a profile also logs in
This commit is contained in:
Matias Alejo Garcia 2014-11-14 19:19:20 -03:00
commit 927e4eebe8
2 changed files with 3 additions and 4 deletions

View file

@ -1,7 +1,7 @@
'use strict'; 'use strict';
angular.module('copayApp.controllers').controller('ImportProfileController', 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(); controllerUtils.redirIfLogged();
$scope.title = 'Import a backup'; $scope.title = 'Import a backup';
@ -30,8 +30,8 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
if (err && !iden) { if (err && !iden) {
$scope.error = (err.toString() || '').match('BADSTR') ? 'Bad password or corrupt profile file' : 'Unknown error'; $scope.error = (err.toString() || '').match('BADSTR') ? 'Bad password or corrupt profile file' : 'Unknown error';
} else { } else {
notification.info('Success', 'Profile imported successfully'); var firstWallet = iden.getLastFocusedWallet();
$location.path('/'); controllerUtils.bindProfile($scope, iden, firstWallet);
} }
}); });
}; };

View file

@ -43,7 +43,6 @@ angular.module('copayApp.services')
$timeout(function() { $timeout(function() {
$rootScope.$digest() $rootScope.$digest()
}, 1); }, 1);
return; return;
} }
var walletOptions = { var walletOptions = {