mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 22:43:30 +03:00
🐛 Fixed Portal links not working
refs 25389193f6
Fixes Portal link identification logic which was broken with updated regex for handling of new product specific plans
This commit is contained in:
parent
a114654e89
commit
666fd36845
@ -336,7 +336,7 @@ export default class App extends React.Component {
|
||||
const productMonthlyPriceQueryRegex = /^(?:(\w+?))?\/monthly$/;
|
||||
const productYearlyPriceQueryRegex = /^(?:(\w+?))?\/monthly$/;
|
||||
const [path] = window.location.hash.substr(1).split('?');
|
||||
const linkRegex = /^\/portal\/?(?:\/(\w+(?:\/\w+)+))?\/?$/;
|
||||
const linkRegex = /^\/portal\/?(?:\/(\w+(?:\/\w+)*))?\/?$/;
|
||||
if (path && linkRegex.test(path)) {
|
||||
const [,pagePath] = path.match(linkRegex);
|
||||
const {page, pageQuery} = this.getPageFromLinkPath(pagePath) || {};
|
||||
|
@ -2,7 +2,7 @@ import calculateDiscount from './discount';
|
||||
|
||||
export function removePortalLinkFromUrl() {
|
||||
const [path] = window.location.hash.substr(1).split('?');
|
||||
const linkRegex = /^\/portal\/?(?:\/(\w+(?:\/\w+)+))?\/?$/;
|
||||
const linkRegex = /^\/portal\/?(?:\/(\w+(?:\/\w+)*))?\/?$/;
|
||||
if (path && linkRegex.test(path)) {
|
||||
window.history.pushState('', document.title, window.location.pathname + window.location.search);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user