From 2e3aef8b2110fc1e5f13b57b2c619c85e9e80e7c Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Mon, 15 Oct 2018 21:36:40 -0400 Subject: [PATCH] simplify --- templates/src/client/start/index.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/templates/src/client/start/index.ts b/templates/src/client/start/index.ts index d2dfa0a..258e791 100644 --- a/templates/src/client/start/index.ts +++ b/templates/src/client/start/index.ts @@ -83,12 +83,8 @@ function handle_click(event: MouseEvent) { const svg = typeof a.href === 'object' && a.href.constructor.name === 'SVGAnimatedString'; const href = String(svg ? (a).href.baseVal : a.href); - if (location.hash && href === location.href) { - return; - } - if (href === location.href) { - event.preventDefault(); + if (!location.hash) event.preventDefault(); return; }