If the copayer upload a backup it does not wait for others

This commit is contained in:
Matias Pando 2014-09-10 17:36:17 -03:00
commit ecea1a654d
3 changed files with 8 additions and 16 deletions

View file

@ -2,12 +2,11 @@
angular.module('copayApp.controllers').controller('ImportController', angular.module('copayApp.controllers').controller('ImportController',
function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, notification) { function($scope, $rootScope, $location, walletFactory, controllerUtils, Passphrase, notification) {
controllerUtils.redirIfLogged(); controllerUtils.redirIfLogged();
$scope.title = 'Import a backup'; $scope.title = 'Import a backup';
$scope.importStatus = 'Importing wallet - Reading backup...'; $scope.importStatus = 'Importing wallet - Reading backup...';
$scope.hideAdv=true; $scope.hideAdv = true;
var reader = new FileReader(); var reader = new FileReader();
@ -59,7 +58,7 @@ angular.module('copayApp.controllers').controller('ImportController',
$rootScope.wallet = w; $rootScope.wallet = w;
controllerUtils.startNetwork($rootScope.wallet, $scope); controllerUtils.startNetwork($rootScope.wallet, $scope);
}); });
}); });
}; };
@ -105,6 +104,6 @@ angular.module('copayApp.controllers').controller('ImportController',
if (backupFile) { if (backupFile) {
reader.readAsBinaryString(backupFile); reader.readAsBinaryString(backupFile);
} }
}; };
}); });

View file

@ -86,6 +86,9 @@ function Wallet(opts) {
this.lastTimestamp = opts.lastTimestamp || undefined; this.lastTimestamp = opts.lastTimestamp || undefined;
this.lastMessageFrom = {}; this.lastMessageFrom = {};
//to avoid confirmation of copayer's backups if is imported from a file
this.isImported = opts.isImported;
this.paymentRequests = opts.paymentRequests || {}; this.paymentRequests = opts.paymentRequests || {};
//network nonces are 8 byte buffers, representing a big endian number //network nonces are 8 byte buffers, representing a big endian number
@ -910,6 +913,7 @@ Wallet.fromObj = function(o, storage, network, blockchain) {
opts.storage = storage; opts.storage = storage;
opts.network = network; opts.network = network;
opts.blockchain = blockchain; opts.blockchain = blockchain;
opts.isImported = true;
return new Wallet(opts); return new Wallet(opts);
}; };
@ -2426,7 +2430,7 @@ Wallet.prototype.isShared = function() {
* @return {boolean} * @return {boolean}
*/ */
Wallet.prototype.isReady = function() { Wallet.prototype.isReady = function() {
var ret = this.publicKeyRing.isComplete() && this.publicKeyRing.isFullyBackup(); var ret = this.publicKeyRing.isComplete() && (this.publicKeyRing.isFullyBackup() || this.isImported);
return ret; return ret;
}; };

View file

@ -75,17 +75,6 @@
</div> </div>
</div> </div>
</div> </div>
<!-- <div class="text-right">
<button class="button secondary m0"
ng-click="skipBackup()"
ng-show="!$root.wallet.publicKeyRing.isBackupReady()"
ng-disabled="!$root.wallet.publicKeyRing.isComplete()">
<span translate ng-show="$root.wallet.publicKeyRing.isComplete()" >
Skip Backup
</span>
</button> -->
<a class="small" ng-click="skipBackup()" <a class="small" ng-click="skipBackup()"
ng-show="!$root.wallet.publicKeyRing.isBackupReady()" ng-show="!$root.wallet.publicKeyRing.isBackupReady()"
ng-disabled="!$root.wallet.publicKeyRing.isComplete()"> ng-disabled="!$root.wallet.publicKeyRing.isComplete()">