add updateIndex to model

This commit is contained in:
Matias Alejo Garcia 2014-11-14 16:00:08 -03:00
commit 0da641d1b8
4 changed files with 31 additions and 16 deletions

View file

@ -36,10 +36,7 @@ angular.module('copayApp.controllers').controller('ImportController',
$scope.error = 'Could not read wallet. Please check your password';
} else {
controllerUtils.installWalletHandlers($scope, wallet);
updateStatus('Importing wallet - Scanning for transactions...');
wallet.updateIndexes(function(err) {
controllerUtils.setFocusedWallet(wallet);
});
controllerUtils.setFocusedWallet(wallet);
}
}
);

View file

@ -28,6 +28,7 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
passphraseConfig: config.passphraseConfig,
}, function(err, iden) {
if (err && !iden) {
$scope.loading = false;
$scope.error = (err.toString() || '').match('BADSTR') ? 'Bad password or corrupt profile file' : 'Unknown error';
} else {
var firstWallet = iden.getLastFocusedWallet();
@ -54,14 +55,13 @@ angular.module('copayApp.controllers').controller('ImportProfileController',
};
$scope.import = function(form) {
$scope.loading = true;
if (form.$invalid) {
$scope.loading = false;
$scope.error = 'Please enter the required fields';
return;
}
$rootScope.starting = true;
var backupFile = $scope.file;
var backupText = form.backupText.$modelValue;
var password = form.password.$modelValue;