mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
Added listener for portal link changes
refs https://github.com/TryGhost/Ghost/issues/12365 - Listens to portal link changes in URL and opens direct checkout plans
This commit is contained in:
parent
4dc22ca568
commit
8483ba162d
@ -311,6 +311,7 @@ export default class App extends React.Component {
|
||||
updateStateForPreviewLinks() {
|
||||
const {site: previewSite, ...restPreviewData} = this.fetchPreviewData();
|
||||
const {site: linkSite, ...restLinkData} = this.fetchLinkData();
|
||||
|
||||
const updatedState = {
|
||||
site: {
|
||||
...this.state.site,
|
||||
@ -320,6 +321,12 @@ export default class App extends React.Component {
|
||||
...restLinkData,
|
||||
...restPreviewData
|
||||
};
|
||||
|
||||
if (!this.state.member && ['monthly', 'yearly'].includes(updatedState.pageQuery) && hasPlan({site: updatedState.site, plan: updatedState.pageQuery})) {
|
||||
removePortalLinkFromUrl();
|
||||
this.onAction('signup', {plan: capitalize(updatedState.pageQuery)});
|
||||
}
|
||||
|
||||
this.setState(updatedState);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user