Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Focused Launch success view: fix CTA rendering conditions #51741
Focused Launch success view: fix CTA rendering conditions #51741
Changes from all commits
9b9808c
13ac5b1
f454e3d
7a45b88
9e373df
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that the same change in logic could have been achieved without refactoring the rest of the files in this PR and the
useWillRedirectAfterSuccess
hook, which in my opinion was a nice abstraction over the implementation details of the in-editor checkout modal vs redirection.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't like that hook much because:
It's doesn't really determine whether we'll redirect. As you can see here we need to check whether we're in free flow too.
If we move the free flow check inside the hook, then we won't be able to use the hook here. Making it an abstraction that is used once.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that the hook determined correctly whether we'll redirect. Here we're checking for the free flow in order to show/hide CTAs (it's a different check which also relies on knowing if the user will be redirected
We wouldn't need to move the free flow check inside the hook, because that free flow check is not needed to know if the page will be redirected — it is only needed to know if we should show the CTA buttons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is true. The hook would return
true
for the free plan in wp-admin (! isInIframe || ! ecommercePlan
), even though we don't redirect in this case. Right?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, now I get your previous reply too — you're correct indeed, we'd need to add the free plan check too.