chore: cleanup checks

This commit is contained in:
userquin 2023-01-07 19:11:10 +01:00
parent c9d70de38e
commit 8e19574ea1

View file

@ -4,7 +4,7 @@ export default defineNuxtPlugin((nuxt) => {
scrollToTop: (evt?: MouseEvent | KeyboardEvent) => { scrollToTop: (evt?: MouseEvent | KeyboardEvent) => {
const path = evt?.composedPath?.() as HTMLElement[] const path = evt?.composedPath?.() as HTMLElement[]
const el = path?.find(el => el.tagName?.toUpperCase() === 'A') as HTMLAnchorElement 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)) if (nuxt.$preventScrollToTop(new URL(el.href, import.meta.url).pathname))
return return
} }