Skip to content

Commit

Permalink
Conditional target
Browse files Browse the repository at this point in the history
  • Loading branch information
sirreal committed Sep 3, 2019
1 parent 4a016a1 commit 0f224cf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions extensions/blocks/recurring-payments/edit.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ class MembershipsButtonEdit extends Component {
}

render = () => {
const { className, notices } = this.props;
const { className, notices, postId } = this.props;
const { connected, products } = this.state;

const stripeConnectUrl = this.getConnectUrl();
Expand Down Expand Up @@ -441,7 +441,11 @@ class MembershipsButtonEdit extends Component {
isLarge
disabled={ ! stripeConnectUrl }
href={ stripeConnectUrl }
target="_blank"
target={
// If we know the postId, we'll try to return to the editor.
// Otherwise the flow will continue externally.
postId ? undefined : '_blank'
}
>
{ __( 'Connect to Stripe or set up an account', 'jetpack' ) }
</Button>
Expand Down

0 comments on commit 0f224cf

Please sign in to comment.