🐛 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:
Rishabh 2021-07-09 06:27:05 +05:30
parent a114654e89
commit 666fd36845
2 changed files with 2 additions and 2 deletions

View File

@ -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) || {};

View File

@ -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);
}