Don't browse to hash if there isn't one

This commit is contained in:
Jake Howard 2022-08-02 21:11:57 +01:00
parent 996f7b9c2a
commit 34293553a8
Signed by: jake
GPG key ID: 57AFB45680EDD477

View file

@ -61,6 +61,10 @@ window.addEventListener("load", () => {
window.addEventListener("DOMContentLoaded", () => { window.addEventListener("DOMContentLoaded", () => {
setHeroHeight(); setHeroHeight();
if (window.location.hash <= 1) {
return;
}
let scrollTarget = null; let scrollTarget = null;
try { try {
scrollTarget = document.getElementById(window.location.hash.slice(1)); scrollTarget = document.getElementById(window.location.hash.slice(1));