store profile if dirty after validation

This commit is contained in:
Matias Alejo Garcia 2016-06-17 12:03:53 -03:00
commit 580b8e64fa
No known key found for this signature in database
GPG key ID: 02470DB551277AB3
2 changed files with 3 additions and 2 deletions

View file

@ -1413,7 +1413,9 @@ angular.module('copayApp.controllers').controller('indexController', function($r
});
$rootScope.$on('Local/ValidatingWalletEnded', function(ev, walletId, isOK) {
profileService.storeProfileIfDirty();
if (self.isInFocus(walletId)) {
// NOTE: If the user changed the wallet, the flag is already turn off.
ongoingProcess.set('validatingWallet', false);
self.incorrectDerivation = isOK === false;
}

View file

@ -132,14 +132,13 @@ angular.module('copayApp.services')
skipDeviceValidation: skipDeviceValidation,
}, function(err, isOK) {
$log.debug('ValidatingWallet End: ' + walletId + ' isOK:' + isOK);
$rootScope.$emit('Local/ValidatingWalletEnded', walletId, isOK);
if (isOK) {
root.profile.setChecked(platformInfo.ua, walletId);
} else {
$log.warn('Key Derivation failed for wallet:' + walletId);
storageService.clearLastAddress(walletId, function() {});
}
$rootScope.$emit('Local/ValidatingWalletEnded', walletId, isOK);
});
}, 5000);
};