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
parent 7618488bc3
commit 63cffcc921
4 changed files with 10 additions and 18 deletions

View File

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

View File

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

View File

@ -108,7 +108,7 @@ angular.module('copayApp.services')
}, 3000);
});
w.on('txProposalEvent', function(e) {
var user = w.publicKeyRing.nicknameForCopayer(e.cId);
switch (e.type) {
case 'signed':

View File

@ -75,17 +75,6 @@
</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()"
ng-show="!$root.wallet.publicKeyRing.isBackupReady()"
ng-disabled="!$root.wallet.publicKeyRing.isComplete()">