mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
🐛 Fixed Portal default page handling
fixes GRO-88 Instead of going to the previous page when visiting /#/portal, it will now go to the default page: - Sign up if you are not signed in - Account home if you are signed in Previously, it had the same behaviour, with the difference that it would also go to the previous page if there was any.
This commit is contained in:
parent
3f70cc08b7
commit
57d43d2d72
@ -741,7 +741,11 @@ export default class App extends React.Component {
|
||||
const customOfferRegex = /^offers\/(\w+?)\/?$/;
|
||||
const site = useSite ?? this.state.site ?? {};
|
||||
|
||||
if (customOfferRegex.test(path)) {
|
||||
if (path === undefined || path === '') {
|
||||
return {
|
||||
page: 'default'
|
||||
};
|
||||
} else if (customOfferRegex.test(path)) {
|
||||
return {
|
||||
pageQuery: path
|
||||
};
|
||||
@ -822,7 +826,9 @@ export default class App extends React.Component {
|
||||
}
|
||||
};
|
||||
}
|
||||
return {};
|
||||
return {
|
||||
page: 'default'
|
||||
};
|
||||
}
|
||||
|
||||
/**Get Accent color from site data*/
|
||||
@ -834,7 +840,7 @@ export default class App extends React.Component {
|
||||
/**Get final page set in App context from state data*/
|
||||
getContextPage({site, page, member}) {
|
||||
/**Set default page based on logged-in status */
|
||||
if (!page) {
|
||||
if (!page || page === 'default') {
|
||||
const loggedOutPage = isInviteOnlySite({site}) ? 'signin' : 'signup';
|
||||
page = member ? 'accountHome' : loggedOutPage;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user