fixed URL being undefined :face_palm:

This commit is contained in:
Phil Hughes 2017-12-07 14:30:00 +00:00
parent 3e789057d2
commit 00fa900fc1
No known key found for this signature in database
GPG Key ID: 32245528C52E0F9F
1 changed files with 2 additions and 2 deletions

View File

@ -58,8 +58,8 @@ export function removeParams(params) {
return url.href;
}
export function getLocationHash(url) {
const hashIndex = window.location.href.indexOf('#');
export function getLocationHash(url = window.location.href) {
const hashIndex = url.indexOf('#');
return hashIndex === -1 ? null : url.substring(hashIndex + 1);
}