@@ -4,17 +4,6 @@ import type { Role, GitHubContributor } from '#server/api/contributors.get'
44const router = useRouter ()
55const canGoBack = useCanGoBack ()
66
7- // SSR & Validation Fix
8- const isMounted = shallowRef (false )
9- const activeContributor = shallowRef <GitHubContributor | null >(null )
10- const openTimer = shallowRef <any >(null )
11- const closeTimer = shallowRef <any >(null )
12- const isFlipped = shallowRef (false )
13-
14- onMounted (() => {
15- isMounted .value = true
16- })
17-
187useSeoMeta ({
198 title : () => ` ${$t (' about.title' )} - npmx ` ,
209 ogTitle : () => ` ${$t (' about.title' )} - npmx ` ,
@@ -30,6 +19,21 @@ defineOgImageComponent('Default', {
3019 description: ' a fast, modern browser for the **npm registry**' ,
3120})
3221
22+ const isMounted = shallowRef (false )
23+ const activeContributor = shallowRef <GitHubContributor | null >(null )
24+ const openTimer = shallowRef <ReturnType <typeof setTimeout > | undefined >()
25+ const closeTimer = shallowRef <ReturnType <typeof setTimeout > | undefined >()
26+ const isFlipped = shallowRef (false )
27+
28+ onMounted (() => {
29+ isMounted .value = true
30+ })
31+
32+ onBeforeUnmount (() => {
33+ if (openTimer .value ) clearTimeout (openTimer .value )
34+ if (closeTimer .value ) clearTimeout (closeTimer .value )
35+ })
36+
3337const pmLinks = {
3438 npm: ' https://www.npmjs.com/' ,
3539 pnpm: ' https://pnpm.io/' ,
@@ -141,7 +145,7 @@ function onMouseEnter(contributor: GitHubContributor) {
141145function cancelClose() {
142146 if (closeTimer .value ) {
143147 clearTimeout (closeTimer .value )
144- closeTimer .value = null
148+ closeTimer .value = undefined
145149 }
146150}
147151
0 commit comments