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:
parent
5844312552
commit
35e5c2d1b9
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue