fix(donate): handle missing stripe keys (#37847)
* fix: gracefully handle missing stripe keys * fix: remove state updates from render (donate)
This commit is contained in:
committed by
mrugesh
parent
81bb677def
commit
c660b389a8
@@ -60,6 +60,7 @@ class DonateFormChildViewForHOC extends Component {
|
||||
this.handleSubmit = this.handleSubmit.bind(this);
|
||||
this.postDonation = this.postDonation.bind(this);
|
||||
this.resetDonation = this.resetDonation.bind(this);
|
||||
this.hideAmountOptions(false);
|
||||
}
|
||||
|
||||
getUserEmail() {
|
||||
@@ -226,7 +227,6 @@ class DonateFormChildViewForHOC extends Component {
|
||||
reset: this.resetDonation
|
||||
});
|
||||
}
|
||||
this.hideAmountOptions(false);
|
||||
return this.renderDonateForm();
|
||||
}
|
||||
}
|
||||
|
@@ -61,11 +61,12 @@ export class DonatePage extends Component {
|
||||
|
||||
handleStripeLoad() {
|
||||
// Create Stripe instance once Stripe.js loads
|
||||
console.info('stripe has loaded');
|
||||
this.setState(state => ({
|
||||
...state,
|
||||
stripe: window.Stripe(stripePublicKey)
|
||||
}));
|
||||
if (stripePublicKey) {
|
||||
this.setState(state => ({
|
||||
...state,
|
||||
stripe: window.Stripe(stripePublicKey)
|
||||
}));
|
||||
}
|
||||
}
|
||||
|
||||
enableDonationSettingsPage(enableSettings = true) {
|
||||
|
Reference in New Issue
Block a user