fixes
This commit is contained in:
parent
d55e756e6a
commit
c7969c9da2
2 changed files with 19 additions and 28 deletions
|
|
@ -12,7 +12,6 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
$scope.formData.secret = null;
|
$scope.formData.secret = null;
|
||||||
resetPasswordFields();
|
resetPasswordFields();
|
||||||
updateSeedSourceSelect();
|
updateSeedSourceSelect();
|
||||||
$scope.setSeedSource();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.showAdvChange = function() {
|
$scope.showAdvChange = function() {
|
||||||
|
|
@ -67,7 +66,7 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
id: 'set',
|
id: 'set',
|
||||||
label: gettextCatalog.getString('Specify Recovery Phrase...'),
|
label: gettextCatalog.getString('Specify Recovery Phrase...'),
|
||||||
}];
|
}];
|
||||||
$scope.formData.seedSource = $scope.seedOptions[0];
|
$scope.seedSource = $scope.seedOptions[0];
|
||||||
/*
|
/*
|
||||||
|
|
||||||
Disable Hardware Wallets
|
Disable Hardware Wallets
|
||||||
|
|
@ -98,14 +97,6 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.setSeedSource = function() {
|
|
||||||
$scope.seedSourceId = $scope.formData.seedSource.id;
|
|
||||||
|
|
||||||
$timeout(function() {
|
|
||||||
$rootScope.$apply();
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
$scope.join = function() {
|
$scope.join = function() {
|
||||||
|
|
||||||
var opts = {
|
var opts = {
|
||||||
|
|
@ -114,7 +105,7 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
bwsurl: $scope.formData.bwsurl
|
bwsurl: $scope.formData.bwsurl
|
||||||
}
|
}
|
||||||
|
|
||||||
var setSeed = $scope.seedSourceId == 'set';
|
var setSeed = $scope.seedSource.id == 'set';
|
||||||
if (setSeed) {
|
if (setSeed) {
|
||||||
var words = $scope.formData.privateKey;
|
var words = $scope.formData.privateKey;
|
||||||
if (words.indexOf(' ') == -1 && words.indexOf('prv') == 1 && words.length > 108) {
|
if (words.indexOf(' ') == -1 && words.indexOf('prv') == 1 && words.length > 108) {
|
||||||
|
|
@ -144,22 +135,22 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($scope.seedSourceId == walletService.externalSource.ledger.id || $scope.seedSourceId == walletService.externalSource.trezor.id || $scope.seedSourceId == walletService.externalSource.intelTEE.id) {
|
if ($scope.seedSource.id == walletService.externalSource.ledger.id || $scope.seedSource.id == walletService.externalSource.trezor.id || $scope.seedSource.id == walletService.externalSource.intelTEE.id) {
|
||||||
var account = $scope.account;
|
var account = $scope.account;
|
||||||
if (!account || account < 1) {
|
if (!account || account < 1) {
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Invalid account number'));
|
popupService.showAlert(gettextCatalog.getString('Error'), gettextCatalog.getString('Invalid account number'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($scope.seedSourceId == walletService.externalSource.trezor.id || $scope.seedSourceId == walletService.externalSource.intelTEE.id)
|
if ($scope.seedSource.id == walletService.externalSource.trezor.id || $scope.seedSource.id == walletService.externalSource.intelTEE.id)
|
||||||
account = account - 1;
|
account = account - 1;
|
||||||
|
|
||||||
opts.account = account;
|
opts.account = account;
|
||||||
opts.isMultisig = true;
|
opts.isMultisig = true;
|
||||||
ongoingProcess.set('connecting' + $scope.seedSourceId, true);
|
ongoingProcess.set('connecting' + $scope.seedSource.id, true);
|
||||||
|
|
||||||
var src;
|
var src;
|
||||||
switch ($scope.seedSourceId) {
|
switch ($scope.seedSource.id) {
|
||||||
case walletService.externalSource.ledger.id:
|
case walletService.externalSource.ledger.id:
|
||||||
src = ledger;
|
src = ledger;
|
||||||
break;
|
break;
|
||||||
|
|
@ -176,7 +167,7 @@ angular.module('copayApp.controllers').controller('joinController',
|
||||||
|
|
||||||
// TODO: cannot currently join an intelTEE testnet wallet (need to detect from the secret)
|
// TODO: cannot currently join an intelTEE testnet wallet (need to detect from the secret)
|
||||||
src.getInfoForNewWallet(true, account, 'livenet', function(err, lopts) {
|
src.getInfoForNewWallet(true, account, 'livenet', function(err, lopts) {
|
||||||
ongoingProcess.set('connecting' + $scope.seedSourceId, false);
|
ongoingProcess.set('connecting' + $scope.seedSource.id, false);
|
||||||
if (err) {
|
if (err) {
|
||||||
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
popupService.showAlert(gettextCatalog.getString('Error'), err);
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
|
|
@ -58,19 +58,19 @@
|
||||||
Wallet Key
|
Wallet Key
|
||||||
</div>
|
</div>
|
||||||
<select class="m10t"
|
<select class="m10t"
|
||||||
ng-model="formData.seedSource"
|
ng-model="seedSource"
|
||||||
ng-options="seed as seed.label for seed in seedOptions"
|
ng-options="seed as seed.label for seed in seedOptions"
|
||||||
ng-change="setSeedSource(); resizeView()">
|
ng-change="resizeView()">
|
||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="item item-input item-stacked-label"
|
<label class="item item-input item-stacked-label"
|
||||||
ng-show="seedSourceId == 'trezor' || seedSourceId == 'ledger'">
|
ng-show="seedSource.id == 'trezor' || seedSource.id == 'ledger'">
|
||||||
<span class="input-label" translate>Account Number</span>
|
<span class="input-label" translate>Account Number</span>
|
||||||
<input type="number" id="account" ng-model="formData.account" ignore-mouse-wheel>
|
<input type="number" id="account" ng-model="formData.account" ignore-mouse-wheel>
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label class="item item-input item-stacked-label" ng-show="seedSourceId=='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 id="ext-master"
|
<input id="ext-master"
|
||||||
placeholder="{{'Enter the recovery phrase (BIP39)'|translate}}"
|
placeholder="{{'Enter the recovery phrase (BIP39)'|translate}}"
|
||||||
|
|
@ -80,16 +80,16 @@
|
||||||
ng-model="formData.privateKey">
|
ng-model="formData.privateKey">
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<ion-toggle class="has-comment" ng-model="encrypt" toggle-class="toggle-positive" ng-change="resizeView()" ng-show="seedSourceId == 'new' || seedSourceId == 'set'">
|
<ion-toggle class="has-comment" ng-model="encrypt" toggle-class="toggle-positive" ng-change="resizeView()" ng-show="seedSource.id == 'new' || seedSource.id == 'set'">
|
||||||
<span class="toggle-label" translate>Add a password</span>
|
<span class="toggle-label" translate>Add a password</span>
|
||||||
</ion-toggle>
|
</ion-toggle>
|
||||||
<div class="comment">
|
<div class="comment">
|
||||||
<span ng-show="seedSourceId == 'new'" translate>Add an optional password to secure the recovery phrase</span>
|
<span ng-show="seedSource.id == 'new'" translate>Add an optional password to secure the recovery phrase</span>
|
||||||
<span ng-show="seedSourceId == 'set'" translate>The recovery phrase could require a password to be imported</span>
|
<span ng-show="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">
|
<div class="item item-input" ng-show="encrypt">
|
||||||
<input ng-show="seedSourceId == 'new'"
|
<input ng-show="seedSource.id == 'new'"
|
||||||
placeholder="{{'Password'|translate}}"
|
placeholder="{{'Password'|translate}}"
|
||||||
type="password"
|
type="password"
|
||||||
autocapitalize="off"
|
autocapitalize="off"
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
ng-change="checkPassword(formData.createPassphrase, formData.repeatPassword)"
|
ng-change="checkPassword(formData.createPassphrase, formData.repeatPassword)"
|
||||||
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
||||||
|
|
||||||
<input ng-show="seedSourceId == 'set'"
|
<input ng-show="seedSource.id == 'set'"
|
||||||
placeholder="{{'Password'|translate}}"
|
placeholder="{{'Password'|translate}}"
|
||||||
type="password"
|
type="password"
|
||||||
autocapitalize="off"
|
autocapitalize="off"
|
||||||
|
|
@ -126,7 +126,7 @@
|
||||||
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
ng-class="{'correct': result == 'correct', 'incorrect': result == 'incorrect'}">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="text-center box-notification error" ng-show="(seedSourceId =='new' || seedSourceId =='set') && encrypt">
|
<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, there is no way you could recover your funds.</strong>
|
<strong translate>This password cannot be recovered. If the password is lost, there is no way you could recover your funds.</strong>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
<span class="toggle-label" translate>I have written it down</span>
|
<span class="toggle-label" translate>I have written it down</span>
|
||||||
</ion-checkbox>
|
</ion-checkbox>
|
||||||
|
|
||||||
<label class="item item-input item-stacked-label" ng-show="seedSourceId == '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"
|
||||||
placeholder="{{'BIP32 path for address derivation'|translate}}"
|
placeholder="{{'BIP32 path for address derivation'|translate}}"
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
</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 || ((encrypt && !passwordSaved) || encrypt && ((seedSourceId == 'new' && !formData.createPassphrase) || (seedSourceId == 'set' && !formData.passphrase)))"
|
ng-disabled="setupForm.$invalid || ((encrypt && !formData.passwordSaved) || encrypt && ((seedSource.id == 'new' && !formData.createPassphrase) || (seedSource.id == 'set' && !formData.passphrase)))"
|
||||||
translate>Join
|
translate>Join
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue