From 8e19574ea17755f01a4458077279efd34cd40cba Mon Sep 17 00:00:00 2001 From: userquin Date: Sat, 7 Jan 2023 19:11:10 +0100 Subject: [PATCH] chore: cleanup checks --- plugins/scroll-to-top.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/scroll-to-top.ts b/plugins/scroll-to-top.ts index 91db4caa..5f67c843 100644 --- a/plugins/scroll-to-top.ts +++ b/plugins/scroll-to-top.ts @@ -4,7 +4,7 @@ export default defineNuxtPlugin((nuxt) => { scrollToTop: (evt?: MouseEvent | KeyboardEvent) => { const path = evt?.composedPath?.() as HTMLElement[] const el = path?.find(el => el.tagName?.toUpperCase() === 'A') as HTMLAnchorElement - if (el && el.href) { + if (el?.href) { if (nuxt.$preventScrollToTop(new URL(el.href, import.meta.url).pathname)) return }