fix backup without seed

This commit is contained in:
Javier 2016-06-02 18:17:31 -03:00
commit 91ac072083
3 changed files with 17 additions and 14 deletions

View file

@ -19,17 +19,17 @@
</section>
</nav>
<div class="content preferences text-center">
<div class="box-notification" ng-show="wordsC.error">
<span class="text-warning">
{{wordsC.error|translate}}
</span>
</div>
<div class="box-notification" ng-show="wordsC.error">
<span class="text-warning" translate>
{{wordsC.error}}
</span>
</div>
<!--
## STEP 1
-->
<div class="content preferences text-center">
<div ng-show="wordsC.step == 1">
<div ng-show="wordsC.mnemonicWords || (wordsC.credentialsEncrypted && !wordsC.deleted)" class="row">
<h5 class="text-center" translate>Write your wallet recovery phrase</h5>
@ -97,7 +97,7 @@
<div class="button-box">
<button
ng-show="!wordsC.deleted"
ng-disabled="wordsC.credentialsEncrypted"
ng-disabled="wordsC.credentialsEncrypted || wordsC.error"
class="round expand m0"
ng-style="{'background-color':index.backgroundColor}"
ng-click="wordsC.goToStep(2);"

View file

@ -16,14 +16,11 @@ angular.module('copayApp.controllers').controller('backupController',
});
};
if (fc.credentials && !fc.credentials.mnemonicEncrypted && !fc.credentials.mnemonic)
self.deleted = true;
if (fc.isPrivKeyEncrypted() && !self.deleted) {
if (fc.isPrivKeyEncrypted() && !isDeletedSeed()) {
self.credentialsEncrypted = true;
passwordRequest();
} else {
if (!self.deleted)
if (!isDeletedSeed())
initWords();
}
@ -34,12 +31,18 @@ angular.module('copayApp.controllers').controller('backupController',
self.shuffledMnemonicWords = shuffledWords(self.mnemonicWords);
self.customWords = [];
self.step = 1;
self.deleted = false;
self.deleted = isDeletedSeed();
self.credentialsEncrypted = false;
self.selectComplete = false;
self.backupError = false;
};
function isDeletedSeed() {
if (lodash.isEmpty(fc.credentials.mnemonic) && lodash.isEmpty(fc.credentials.mnemonicEncrypted))
return true;
return false;
};
self.goToStep = function(n) {
self.step = n;
if (self.step == 1)

View file

@ -327,7 +327,7 @@ button.radius, .button.radius {
left: 0;
width: 100%;
padding: 0.8rem;
z-index: 9999;
z-index: 1;
}
.backup .button-box {