mirror of https://github.com/BTCPrivate/copay.git
ref password and andvanced options oncreate personal view
This commit is contained in:
parent
d658a3a98c
commit
1ab4504824
|
@ -37,9 +37,24 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.showAdvChange = function() {
|
$scope.showAdvChange = function() {
|
||||||
|
$scope.showAdv = !$scope.showAdv;
|
||||||
|
$scope.resizeView();
|
||||||
|
};
|
||||||
|
|
||||||
|
$scope.resizeView = function() {
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
$ionicScrollDelegate.resize();
|
$ionicScrollDelegate.resize();
|
||||||
}, 10);
|
});
|
||||||
|
checkPasswordFields();
|
||||||
|
};
|
||||||
|
|
||||||
|
function checkPasswordFields() {
|
||||||
|
if (!$scope.encrypt) {
|
||||||
|
$scope.formData.passphrase = $scope.formData.createPassphrase = $scope.formData.passwordSaved = null;
|
||||||
|
$timeout(function() {
|
||||||
|
$scope.$apply();
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function updateRCSelect(n) {
|
function updateRCSelect(n) {
|
||||||
|
@ -160,7 +175,8 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
function _create(opts) {
|
function _create(opts) {
|
||||||
ongoingProcess.set('creatingWallet', true);
|
ongoingProcess.set('creatingWallet', true);
|
||||||
$timeout(function() {
|
$timeout(function() {
|
||||||
|
console.log(opts);
|
||||||
|
return;
|
||||||
profileService.createWallet(opts, function(err, client) {
|
profileService.createWallet(opts, function(err, client) {
|
||||||
ongoingProcess.set('creatingWallet', false);
|
ongoingProcess.set('creatingWallet', false);
|
||||||
if (err) {
|
if (err) {
|
||||||
|
@ -173,11 +189,12 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
$log.debug('Remote preferences saved for:' + client.credentials.walletId)
|
$log.debug('Remote preferences saved for:' + client.credentials.walletId)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
if ($scope.seedSource.id == 'set') {
|
if ($scope.seedSource.id == 'set') {
|
||||||
profileService.setBackupFlag(client.credentials.walletId);
|
profileService.setBackupFlag(client.credentials.walletId);
|
||||||
}
|
}
|
||||||
|
|
||||||
$ionicHistory.removeBackView();
|
$ionicHistory.removeBackView();
|
||||||
|
|
||||||
if (!client.isComplete()) {
|
if (!client.isComplete()) {
|
||||||
$ionicHistory.nextViewOptions({
|
$ionicHistory.nextViewOptions({
|
||||||
disableAnimate: true
|
disableAnimate: true
|
||||||
|
@ -188,8 +205,7 @@ angular.module('copayApp.controllers').controller('createController',
|
||||||
walletId: client.credentials.walletId
|
walletId: client.credentials.walletId
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
} else $state.go('tabs.home');
|
||||||
else $state.go('tabs.home')
|
|
||||||
});
|
});
|
||||||
}, 100);
|
}, 100);
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,10 +18,12 @@
|
||||||
ng-blur="formFocus(false)">
|
ng-blur="formFocus(false)">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<ion-toggle ng-model="showAdv" toggle-class="toggle-stable" ng-change="showAdvChange()">
|
<div class="item item-divider"></div>
|
||||||
|
|
||||||
|
<a class="item" ng-click="showAdvChange()">
|
||||||
<span translate ng-show="!showAdv">Show advanced options</span>
|
<span translate ng-show="!showAdv">Show advanced options</span>
|
||||||
<span translate ng-show="showAdv">Hide advanced options</span>
|
<span translate ng-show="showAdv">Hide advanced options</span>
|
||||||
</ion-toggle>
|
</a>
|
||||||
|
|
||||||
<div ng-show="showAdv">
|
<div ng-show="showAdv">
|
||||||
<label class="item item-input item-stacked-label">
|
<label class="item item-input item-stacked-label">
|
||||||
|
@ -41,20 +43,6 @@
|
||||||
<input type="number" ng-model="formData.account" ignore-mouse-wheel>
|
<input type="number" ng-model="formData.account" ignore-mouse-wheel>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<div class="card" ng-show="seedSource.id == 'new' && createPassphrase">
|
|
||||||
<div class="item item-text-wrap" translate>
|
|
||||||
WARNING: The password cannot be recovered. <b>Be sure to write it down</b>. The wallet can not be restored without the password.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'new'">
|
|
||||||
<span class="input-label" translate>Add a Password</span>
|
|
||||||
<input type="text"
|
|
||||||
placeholder="{{'Add an optional password to secure the recovery phrase'|translate}}"
|
|
||||||
autocapitalize="off"
|
|
||||||
ng-model="formData.createPassphrase">
|
|
||||||
</label>
|
|
||||||
|
|
||||||
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'set'">
|
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'set'">
|
||||||
<span class="input-label" translate>Wallet Recovery Phrase</span>
|
<span class="input-label" translate>Wallet Recovery Phrase</span>
|
||||||
<input placeholder="{{'Enter the recovery phrase (BIP39)'|translate}}"
|
<input placeholder="{{'Enter the recovery phrase (BIP39)'|translate}}"
|
||||||
|
@ -63,14 +51,34 @@
|
||||||
ng-model="formData.privateKey">
|
ng-model="formData.privateKey">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'set'">
|
<ion-toggle ng-model="encrypt" toggle-class="toggle-positive" ng-change="resizeView()" ng-show="seedSource.id == 'new' || seedSource.id == 'set'">
|
||||||
<span class="input-label" translate>Password</span>
|
<span translate>Encrypt with a Password</span>
|
||||||
|
</ion-toggle>
|
||||||
|
|
||||||
|
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'new' && encrypt">
|
||||||
|
<span class="input-label" translate>Add a Password</span>
|
||||||
|
<input type="text"
|
||||||
|
placeholder="{{'Add an optional password to secure the recovery phrase'|translate}}"
|
||||||
|
autocapitalize="off"
|
||||||
|
ng-model="formData.createPassphrase">
|
||||||
|
</label>
|
||||||
|
|
||||||
|
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'set' && encrypt">
|
||||||
|
<span class="input-label" translate>Add a Password</span>
|
||||||
<input type="text"
|
<input type="text"
|
||||||
placeholder="{{'The recovery phrase could require a password to be imported'|translate}}"
|
placeholder="{{'The recovery phrase could require a password to be imported'|translate}}"
|
||||||
autocapitalize="off"
|
autocapitalize="off"
|
||||||
ng-model="formData.passphrase">
|
ng-model="formData.passphrase">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
|
<div class="text-center box-notification error" ng-show="(seedSource.id =='new' || seedSource.id =='set') && encrypt">
|
||||||
|
<strong translate>This password cannot be recovered. If the password is lost, funds can only be recovered with a valid backup.</strong>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<ion-checkbox ng-model="formData.passwordSaved" class="checkbox-positive" ng-show="encrypt">
|
||||||
|
<span class="toggle-label" translate>I have written it down</span>
|
||||||
|
</ion-checkbox>
|
||||||
|
|
||||||
<label class="item item-input item-stacked-label" ng-show="seedSource.id == 'set'">
|
<label class="item item-input item-stacked-label" ng-show="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"
|
||||||
|
@ -90,7 +98,8 @@
|
||||||
</div> <!-- advanced -->
|
</div> <!-- advanced -->
|
||||||
</div> <!-- list -->
|
</div> <!-- list -->
|
||||||
|
|
||||||
<button type="submit" class="button button-block button-positive" ng-disabled="setupForm.$invalid">
|
<button type="submit" class="button button-block button-positive"
|
||||||
|
ng-disabled="setupForm.$invalid || ((encrypt && !formData.passwordSaved) || encrypt && ((seedSource.id == 'new' && !formData.createPassphrase) || (seedSource.id == 'set' && !formData.passphrase)))">
|
||||||
<span translate>Create new wallet</span>
|
<span translate>Create new wallet</span>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
Loading…
Reference in New Issue