Merge pull request #1353 from matiaspando/feature/skipBackup

Skiping backup
This commit is contained in:
Gustavo Maximiliano Cortez 2014-09-12 15:27:58 -03:00
commit d0d49f17ef
6 changed files with 31 additions and 25 deletions

View File

@ -1046,7 +1046,7 @@ a.text-warning:hover {color: #FD7262;}
background: #2C3E50;
-moz-box-shadow: 0px 0px 0px 0px rgba(255,255,255,0.09), inset 0px 0px 2px 0px rgba(0,0,0,0.20);
box-shadow: 0px 0px 0px 0px rgba(255,255,255,0.09), inset 0px 0px 2px 0px rgba(0,0,0,0.20);
margin-bottom: 5px;
margin-bottom: 15px;
}
.box-setup-copay-required {

View File

@ -5,6 +5,12 @@ angular.module('copayApp.controllers').controller('CopayersController',
$scope.hideAdv = true;
$scope.skipBackup = function() {
var w = $rootScope.wallet;
w.setBackupReady(true);
};
$scope.backup = function() {
var w = $rootScope.wallet;
w.setBackupReady();

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,13 @@ 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 || false;
//to avoid waiting others copayers to make a backup and login immediatly
this.forcedLogin = opts.forcedLogin || false;
this.paymentRequests = opts.paymentRequests || {};
//network nonces are 8 byte buffers, representing a big endian number
@ -910,6 +917,7 @@ Wallet.fromObj = function(o, storage, network, blockchain) {
opts.storage = storage;
opts.network = network;
opts.blockchain = blockchain;
opts.isImported = true;
return new Wallet(opts);
};
@ -2426,7 +2434,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 || this.forcedLogin);
return ret;
};
@ -2435,7 +2443,8 @@ Wallet.prototype.isReady = function() {
*
* Also backs up the wallet
*/
Wallet.prototype.setBackupReady = function() {
Wallet.prototype.setBackupReady = function(forcedLogin) {
this.forcedLogin = forcedLogin;
this.publicKeyRing.setBackupReady();
this.sendPublicKeyRing();
this.store();

View File

@ -51,6 +51,7 @@
</div>
<div class="box-setup-copayers p20">
<p class="text-primary m10b" ng-show="$root.wallet && $root.wallet.publicKeyRing.isComplete()" translate>Creating and storing a backup will allow to restore funds of the wallet</p>
<div class="oh">
<div ng-include="'views/includes/copayer.html'"></div>
<div ng-if="!$root.wallet.publicKeyRing.isComplete()">
@ -74,23 +75,7 @@
</div>
</div>
</div>
<div class="text-right">
<div class="left text-left m10b">
<a class="expand small" ng-click="hideAdv=!hideAdv">
<span translate ng-hide="!hideAdv">Show</span>
<span translate ng-hide="hideAdv">Hide</span>
<span translate>advanced options</span>
</a>
<div ng-hide="hideAdv">
<a translate class="text-warning" ng-really-click="deleteWallet()"
ng-really-message="Are you sure to delete this wallet from this computer?">Delete wallet</a>
<span class="text-gray">|</span>
<a translate class="text-primary m20r" ng-click="downloadBackup()"
ng-show="!$root.wallet.publicKeyRing.isComplete()">Download seed backup</a>
</div>
</div>
<button class="button primary m0"
<button class="button primary right m0"
ng-click="backup()"
ng-show="!$root.wallet.publicKeyRing.isBackupReady()"
ng-disabled="!$root.wallet.publicKeyRing.isComplete()">
@ -108,6 +93,13 @@
<span translate>yet to join.</span>
</span>
</button>
<a class="text-primary m15t m20r right" ng-click="skipBackup()"
ng-show="!$root.wallet.publicKeyRing.isBackupReady()"
ng-disabled="!$root.wallet.publicKeyRing.isComplete()">
<span class="size-12" translate ng-show="$root.wallet.publicKeyRing.isComplete()" >
Skip Backup
</span>
</a>
<button class="button primary"
disabled="disabled"
ng-show="$root.wallet.publicKeyRing.isBackupReady()">

View File

@ -69,7 +69,7 @@
name="joinPasswordConfirm"
ng-model="joinPasswordConfirm"
match="joinPassword" required>
<a class="expand small" ng-click="hideAdv=!hideAdv">
<a class="expand small left" ng-click="hideAdv=!hideAdv">
<span translate ng-hide="!hideAdv">Show</span>
<span translate ng-hide="hideAdv">Hide</span>
<span translate>advanced options</span>