Skip to content

Commit

Permalink
Merge pull request #11595 from JohnathanWhite/fix/intro-network
Browse files Browse the repository at this point in the history
[FIX] card intro hardcoding network
  • Loading branch information
cmgustavo authored Mar 31, 2021
2 parents ee73413 + 6b14a89 commit 6279dd7
Showing 1 changed file with 3 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export class BitPayCardIntroPage {
public accounts;
public cardExperimentEnabled: boolean;
public ready: boolean;
private network: Network;
public bitPayIdConnected: boolean;
constructor(
private translate: TranslateService,
Expand All @@ -47,9 +46,6 @@ export class BitPayCardIntroPage {
this.persistenceProvider.getCardExperimentFlag().then(status => {
this.cardExperimentEnabled = status === 'enabled';
});
this.persistenceProvider
.getNetwork()
.then(network => (this.network = network));
}

ionViewWillEnter() {
Expand Down Expand Up @@ -119,7 +115,7 @@ export class BitPayCardIntroPage {

ionViewDidEnter() {
this.persistenceProvider
.getBitPayIdPairingToken(this.network)
.getBitPayIdPairingToken(Network.livenet)
.then(token => (this.bitPayIdConnected = !!token));

this.iabCardProvider.updateWalletStatus();
Expand Down Expand Up @@ -150,16 +146,15 @@ export class BitPayCardIntroPage {
}

public async orderBitPayCard(path?: 'login' | 'createAccount') {
const root = this.network === 'livenet' ? 'bitpay.com' : 'test.bitpay.com';
let url = `https://${root}/wallet-card?context=${path}`;
let url = `https://bitpay.com/wallet-card?context=${path}`;

if (this.themeProvider.isDarkModeEnabled()) {
url += '&darkMode=true';
}

if (this.bitPayIdConnected) {
const user = await this.persistenceProvider.getBitPayIdUserInfo(
this.network
Network.livenet
);
url += `&email=${user.email}`;
}
Expand Down

0 comments on commit 6279dd7

Please sign in to comment.