Skip to content

Commit

Permalink
Ensures singular attachment for 3DS container
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissrogers committed Jan 29, 2024
1 parent d77cb71 commit 70abd66
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/three-d-secure-action.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ export default class ThreeDSecureAction extends React.PureComponent {

const { actionTokenId } = props;

this._attached = false;
this._container = React.createRef();
this._risk = this.context.recurly.Risk();
this._threeDSecure = this._risk.ThreeDSecure({ actionTokenId });
Expand All @@ -82,7 +83,9 @@ export default class ThreeDSecureAction extends React.PureComponent {
}

componentDidMount () {
if (this._attached) return;
this._threeDSecure.attach(this._container.current);
this._attached = true;
}

render () {
Expand Down

0 comments on commit 70abd66

Please sign in to comment.