0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed portal link removal on popup close

no refs

Last commit updated the portal link regex to allow for trailing slashes, this updates the check for removing portal link when popup is closed
This commit is contained in:
Rish 2021-03-10 09:38:33 +05:30
parent 5844312552
commit 35e5c2d1b9

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