Skip to content

Commit

Permalink
Merge pull request #32 from peopleconnectus/fix/wormhole-modal
Browse files Browse the repository at this point in the history
Fix bug with afterRender hook when rendering within ember-wormhole
  • Loading branch information
TopsyCM committed Nov 28, 2018
2 parents 1c938f3 + 57baad6 commit ed33762
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions app/components/paypal-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ export default Component.extend({
didInsertElement() {
this._super(...arguments);

try {
this.renderPaypal();
} catch (error) {
// Paypal script did not load or errored on render
}
run.scheduleOnce('afterRender', () => {
try {
this.renderPaypal();
} catch (error) {
// Paypal script did not load or errored on render
}
});
},

renderPaypal() {
Expand Down

0 comments on commit ed33762

Please sign in to comment.