Skip to content

Commit 58a697a

Browse files
authored
Merge pull request #9528 from gabrielbazan7/ref/join-coin
[REF] replace coin automatically from invitation code
2 parents 231422f + 3a9ff5d commit 58a697a

File tree

2 files changed

+6
-12
lines changed

2 files changed

+6
-12
lines changed

src/pages/add/join-wallet/join-wallet.html

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,11 @@
1515
<ion-label stacked>{{'Wallet invitation' | translate}}</ion-label>
1616
<ion-input type="text" formControlName="invitationCode" (ionChange)="processInvitation(joinForm.value.invitationCode)" placeholder="{{'Enter wallet invitation'| translate}}"></ion-input>
1717

18-
<ion-icon *ngIf="joinForm.controls.invitationCode.status == 'VALID'" name="ios-checkmark-circle" class="check success" item-right></ion-icon>
18+
<ion-icon *ngIf="joinForm.controls['invitationCode'].status == 'VALID'" name="ios-checkmark-circle" class="check success" item-right></ion-icon>
1919

2020
<ion-icon class="scanner-icon" name="qr-scanner" item-right (click)="openScanner()"></ion-icon>
2121
</ion-item>
2222

23-
<ion-item>
24-
<ion-label stacked>{{'Coin' | translate}}</ion-label>
25-
<ion-select okText="{{okText}}" cancelText="{{cancelText}}" placeholder="{{'Select a coin' | translate}}" formControlName="coin">
26-
<ion-option value="btc">Bitcoin (BTC)</ion-option>
27-
<ion-option value="bch">Bitcoin Cash (BCH)</ion-option>
28-
</ion-select>
29-
</ion-item>
30-
3123
<ion-item-divider></ion-item-divider>
3224

3325
<ion-item (click)="showAdvOpts = !showAdvOpts">

src/pages/add/join-wallet/join-wallet.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import { PopupProvider } from '../../../providers/popup/popup';
1919
import { ProfileProvider } from '../../../providers/profile/profile';
2020
import { PushNotificationsProvider } from '../../../providers/push-notifications/push-notifications';
2121
import {
22+
Coin,
2223
WalletOptions,
2324
WalletProvider
2425
} from '../../../providers/wallet/wallet';
@@ -38,6 +39,7 @@ export class JoinWalletPage {
3839
private derivationPathByDefault: string;
3940
private derivationPathForTestnet: string;
4041
private regex: RegExp;
42+
private coin: Coin;
4143

4244
constructor(
4345
private app: App,
@@ -76,8 +78,7 @@ export class JoinWalletPage {
7678
bwsURL: [this.defaults.bws.url],
7779
selectedSeed: ['new'],
7880
recoveryPhrase: [null],
79-
derivationPath: [this.derivationPathByDefault],
80-
coin: [null, Validators.required]
81+
derivationPath: [this.derivationPathByDefault]
8182
});
8283

8384
this.seedOptions = [
@@ -163,6 +164,7 @@ export class JoinWalletPage {
163164
try {
164165
walletData = this.bwcProvider.parseSecret(invitation);
165166
this.setDerivationPath(walletData.network);
167+
this.coin = walletData.coin;
166168
this.logger.info('Correct invitation code for ' + walletData.network);
167169
} catch (ex) {
168170
this.logger.warn('Error parsing invitation: ' + ex);
@@ -175,7 +177,7 @@ export class JoinWalletPage {
175177
secret: this.joinForm.value.invitationCode,
176178
myName: this.joinForm.value.myName,
177179
bwsurl: this.joinForm.value.bwsURL,
178-
coin: this.joinForm.value.coin
180+
coin: this.coin
179181
};
180182

181183
const setSeed = this.joinForm.value.selectedSeed == 'set';

0 commit comments

Comments
 (0)