remove spending password from create personal or shared
This commit is contained in:
parent
f4de8d4f05
commit
9f0698ec70
3 changed files with 2 additions and 132 deletions
|
|
@ -47,36 +47,13 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
|
|
||||||
$scope.showAdvChange = function() {
|
$scope.showAdvChange = function() {
|
||||||
$scope.showAdv = !$scope.showAdv;
|
$scope.showAdv = !$scope.showAdv;
|
||||||
$scope.encrypt = null;
|
|
||||||
$scope.resizeView();
|
$scope.resizeView();
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.checkPassword = function(pw1, pw2) {
|
|
||||||
if (pw1 && pw1.length > 0) {
|
|
||||||
if (pw2 && pw2.length > 0) {
|
|
||||||
if (pw1 == pw2) $scope.result = 'correct';
|
|
||||||
else {
|
|
||||||
$scope.formData.passwordSaved = null;
|
|
||||||
$scope.result = 'incorrect';
|
|
||||||
}
|
|
||||||
} else
|
|
||||||
$scope.result = null;
|
|
||||||
} else
|
|
||||||
$scope.result = null;
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.resizeView = function() {
|
$scope.resizeView = function() {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$ionicScrollDelegate.resize();
|
$ionicScrollDelegate.resize();
|
||||||
}, 10);
|
}, 10);
|
||||||
resetPasswordFields();
|
|
||||||
};
|
|
||||||
|
|
||||||
function resetPasswordFields() {
|
|
||||||
$scope.formData.passphrase = $scope.formData.createPassphrase = $scope.formData.passwordSaved = $scope.formData.repeatPassword = $scope.result = null;
|
|
||||||
$timeout(function() {
|
|
||||||
$scope.$apply();
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
function updateRCSelect(n) {
|
function updateRCSelect(n) {
|
||||||
|
|
|
||||||
|
|
@ -54,59 +54,6 @@
|
||||||
ng-model="formData.privateKey">
|
ng-model="formData.privateKey">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div ng-show="formData.seedSource.id == 'new' || formData.seedSource.id == 'set'">
|
|
||||||
<ion-toggle class="has-comment" ng-model="encrypt" toggle-class="toggle-positive" ng-change="resizeView()">
|
|
||||||
<span class="toggle-label" translate>Add a password</span>
|
|
||||||
</ion-toggle>
|
|
||||||
<div class="comment">
|
|
||||||
<span ng-show="formData.seedSource.id == 'new'" translate>Add an optional password to secure the recovery phrase</span>
|
|
||||||
<span ng-show="formData.seedSource.id == 'set'" translate>The recovery phrase could require a password to be imported</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item item-input" ng-show="encrypt">
|
|
||||||
<input ng-show="formData.seedSource.id == 'new'"
|
|
||||||
placeholder="{{'Password'|translate}}"
|
|
||||||
type="password"
|
|
||||||
autocapitalize="off"
|
|
||||||
ng-model="formData.createPassphrase"
|
|
||||||
ng-change="checkPassword(formData.createPassphrase, formData.repeatPassword)"
|
|
||||||
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
|
||||||
|
|
||||||
<input ng-show="formData.seedSource.id == 'set'"
|
|
||||||
placeholder="{{'Password'|translate}}"
|
|
||||||
type="password"
|
|
||||||
autocapitalize="off"
|
|
||||||
ng-model="formData.passphrase"
|
|
||||||
ng-change="checkPassword(formData.passphrase, formData.repeatPassword)"
|
|
||||||
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
|
||||||
</div>
|
|
||||||
<div class="item item-input" ng-show="encrypt">
|
|
||||||
<input ng-show="formData.seedSource.id == 'new'"
|
|
||||||
placeholder="{{'Repeat password'|translate}}"
|
|
||||||
type="password"
|
|
||||||
autocapitalize="off"
|
|
||||||
ng-model="formData.repeatPassword"
|
|
||||||
ng-change="checkPassword(formData.createPassphrase, formData.repeatPassword)"
|
|
||||||
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
|
||||||
|
|
||||||
<input ng-show="formData.seedSource.id == 'set'"
|
|
||||||
placeholder="{{'Repeat password'|translate}}"
|
|
||||||
type="password"
|
|
||||||
autocapitalize="off"
|
|
||||||
ng-model="formData.repeatPassword"
|
|
||||||
ng-change="checkPassword(formData.passphrase, formData.repeatPassword)"
|
|
||||||
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="text-center box-notification error" ng-show="(formData.seedSource.id =='new' || formData.seedSource.id =='set') && encrypt">
|
|
||||||
<strong translate>This password cannot be recovered. If the password is lost, there is no way you could recover your funds.</strong>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ion-checkbox ng-model="formData.passwordSaved" class="checkbox-positive" ng-show="encrypt && result == 'correct'">
|
|
||||||
<span class="toggle-label" translate>I have written it down</span>
|
|
||||||
</ion-checkbox>
|
|
||||||
|
|
||||||
<label class="item item-input item-stacked-label" ng-show="formData.seedSource.id == 'set'">
|
<label class="item item-input item-stacked-label" ng-show="formData.seedSource.id == 'set'">
|
||||||
<span class="input-label" translate>Derivation Path</span>
|
<span class="input-label" translate>Derivation Path</span>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
|
|
@ -126,8 +73,7 @@
|
||||||
</div> <!-- advanced -->
|
</div> <!-- advanced -->
|
||||||
</div> <!-- list -->
|
</div> <!-- list -->
|
||||||
|
|
||||||
<button type="submit" class="button button-standard button-primary"
|
<button type="submit" class="button button-standard button-primary" ng-disabled="setupForm.$invalid">
|
||||||
ng-disabled="setupForm.$invalid || ((encrypt && !formData.passwordSaved) || encrypt && ((formData.seedSource.id == 'new' && !formData.createPassphrase) || (formData.seedSource.id == 'set' && !formData.passphrase)))">
|
|
||||||
<span translate>Create new wallet</span>
|
<span translate>Create new wallet</span>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
|
|
@ -83,58 +83,6 @@
|
||||||
ng-model="formData.privateKey">
|
ng-model="formData.privateKey">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div ng-show="formData.seedSource.id == 'new' || formData.seedSource.id == 'set'">
|
|
||||||
<ion-toggle class="has-comment" ng-model="encrypt" toggle-class="toggle-positive" ng-change="resizeView()">
|
|
||||||
<span class="toggle-label" translate>Add a password</span>
|
|
||||||
</ion-toggle>
|
|
||||||
<div class="comment">
|
|
||||||
<span ng-show="formData.seedSource.id == 'new'" translate>Add an optional password to secure the recovery phrase</span>
|
|
||||||
<span ng-show="formData.seedSource.id == 'set'" translate>The recovery phrase could require a password to be imported</span>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="item item-input" ng-show="encrypt">
|
|
||||||
<input ng-show="formData.seedSource.id == 'new'"
|
|
||||||
placeholder="{{'Password'|translate}}"
|
|
||||||
type="password"
|
|
||||||
autocapitalize="off"
|
|
||||||
ng-model="formData.createPassphrase"
|
|
||||||
ng-change="checkPassword(formData.createPassphrase, formData.repeatPassword)"
|
|
||||||
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
|
||||||
|
|
||||||
<input ng-show="formData.seedSource.id == 'set'"
|
|
||||||
placeholder="{{'Password'|translate}}"
|
|
||||||
type="password"
|
|
||||||
autocapitalize="off"
|
|
||||||
ng-model="formData.passphrase"
|
|
||||||
ng-change="checkPassword(formData.passphrase, formData.repeatPassword)"
|
|
||||||
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
|
||||||
</div>
|
|
||||||
<div class="item item-input" ng-show="encrypt">
|
|
||||||
<input ng-show="formData.seedSource.id == 'new'"
|
|
||||||
placeholder="{{'Repeat password'|translate}}"
|
|
||||||
type="password"
|
|
||||||
autocapitalize="off"
|
|
||||||
ng-model="formData.repeatPassword"
|
|
||||||
ng-change="checkPassword(formData.createPassphrase, formData.repeatPassword)"
|
|
||||||
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
|
||||||
|
|
||||||
<input ng-show="formData.seedSource.id == 'set'"
|
|
||||||
placeholder="{{'Repeat password'|translate}}"
|
|
||||||
type="password"
|
|
||||||
autocapitalize="off"
|
|
||||||
ng-model="formData.repeatPassword"
|
|
||||||
ng-change="checkPassword(formData.passphrase, formData.repeatPassword)"
|
|
||||||
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="text-center box-notification error" ng-show="(formData.seedSource.id =='new' || formData.seedSource.id =='set') && encrypt">
|
|
||||||
<strong translate>This password cannot be recovered. If the password is lost, there is no way you could recover your funds.</strong>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<ion-checkbox ng-model="formData.passwordSaved" class="checkbox-positive" ng-show="encrypt && result == 'correct'">
|
|
||||||
<span class="toggle-label" translate>I have written it down</span>
|
|
||||||
</ion-checkbox>
|
|
||||||
|
|
||||||
<label class="item item-input item-stacked-label" ng-show="formData.seedSource.id == 'set'">
|
<label class="item item-input item-stacked-label" ng-show="formData.seedSource.id == 'set'">
|
||||||
<span class="input-label" translate>Derivation Path</span>
|
<span class="input-label" translate>Derivation Path</span>
|
||||||
|
|
@ -155,8 +103,7 @@
|
||||||
</div> <!-- advanced -->
|
</div> <!-- advanced -->
|
||||||
</div> <!-- list -->
|
</div> <!-- list -->
|
||||||
|
|
||||||
<button type="submit" class="button button-standard button-primary"
|
<button type="submit" class="button button-standard button-primary" ng-disabled="setupForm.$invalid">
|
||||||
ng-disabled="setupForm.$invalid || ((encrypt && !formData.passwordSaved) || encrypt && ((formData.seedSource.id == 'new' && !formData.createPassphrase) || (formData.seedSource.id == 'set' && !formData.passphrase)))">
|
|
||||||
<span translate>Create {{formData.requiredCopayers}}-of-{{formData.totalCopayers}} wallet</span>
|
<span translate>Create {{formData.requiredCopayers}}-of-{{formData.totalCopayers}} wallet</span>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue