clear error after recreate

This commit is contained in:
Matias Alejo Garcia 2015-04-18 07:23:11 -03:00
commit 563b318db6
3 changed files with 9 additions and 8 deletions

View file

@ -38,6 +38,7 @@ angular.module('copayApp.controllers').controller('importController',
self.error = err; self.error = err;
} }
else { else {
$rootScope.$emit('Local/WalletImported', walletId);
go.walletHome(); go.walletHome();
notification.success('Success', 'Your wallet has been imported correctly'); notification.success('Success', 'Your wallet has been imported correctly');
} }

View file

@ -338,7 +338,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
if (used) { if (used) {
$log.debug('Address ' + addr + ' was used. Cleaning Cache.') $log.debug('Address ' + addr + ' was used. Cleaning Cache.')
$rootScope.$emit('Local/NeedNewAddress', err); $rootScope.$emit('Local/NeedNewAddress', err);
storageService.clearLastAddress(self.walletId, function(err, addr) { storageService.clearLastAddress(self.walletId, function(err) {
if (cb) return cb(); if (cb) return cb();
}); });
}; };
@ -350,6 +350,7 @@ angular.module('copayApp.controllers').controller('indexController', function($r
self.recreate = function(cb) { self.recreate = function(cb) {
var fc = profileService.focusedClient; var fc = profileService.focusedClient;
self.setOngoingProcess('recreating', true); self.setOngoingProcess('recreating', true);
self.clientError = null;
fc.recreateWallet(function(err) { fc.recreateWallet(function(err) {
self.notAuthorized = false; self.notAuthorized = false;
self.setOngoingProcess('recreating', false); self.setOngoingProcess('recreating', false);
@ -361,12 +362,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
} }
profileService.setWalletClients(); profileService.setWalletClients();
storageService.clearLastAddress(self.walletId, function(err, addr) {
$timeout(function() { $timeout(function() {
$rootScope.$emit('Local/WalletImported', self.walletId); $rootScope.$emit('Local/WalletImported', self.walletId);
}, 100); }, 100);
}); });
});
}; };
self.openMenu = function() { self.openMenu = function() {
@ -460,8 +459,10 @@ angular.module('copayApp.controllers').controller('indexController', function($r
}); });
$rootScope.$on('Local/WalletImported', function(event, walletId) { $rootScope.$on('Local/WalletImported', function(event, walletId) {
storageService.clearLastAddress(walletId, function(err) {
self.startScan(walletId); self.startScan(walletId);
}); });
});
$rootScope.$on('Animation/Disable', function(event) { $rootScope.$on('Animation/Disable', function(event) {
$timeout(function() { $timeout(function() {

View file

@ -253,7 +253,6 @@ angular.module('copayApp.services')
root.setAndStoreFocus(walletId, function() { root.setAndStoreFocus(walletId, function() {
storageService.storeProfile(root.profile, function(err) { storageService.storeProfile(root.profile, function(err) {
$rootScope.$emit('Local/WalletImported', walletId);
return cb(null, walletId); return cb(null, walletId);
}); });
}); });