[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot] 2024-06-14 15:41:51 +00:00 committed by GitHub
parent 0ead860117
commit c2e22c60e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 8 deletions

View File

@ -14,7 +14,7 @@ import { onNuxtReady } from '../composables/ready'
import { navigateTo, useRouter } from '../composables/router'
import { useNuxtApp, useRuntimeConfig } from '../nuxt'
import { cancelIdleCallback, requestIdleCallback } from '../compat/idle-callback'
import type { ObserveFn, CallbackFn } from '../utils'
import type { CallbackFn, ObserveFn } from '../utils'
// @ts-expect-error virtual file
import { nuxtLinkDefaults } from '#build/nuxt.config.mjs'
@ -480,7 +480,7 @@ function useObserver (): { observe: ObserveFn } | undefined {
}
const _observer = nuxtApp._observer = {
observe
observe,
}
return _observer

View File

@ -4,11 +4,11 @@ import type { Component, Ref } from 'vue'
import type { ObserveFn } from '#app/utils'
import { getFragmentHTML } from '#app/components/utils'
import { useNuxtApp } from '#app/nuxt'
import { requestIdleCallback, cancelIdleCallback } from '#app/compat/idle-callback'
import { cancelIdleCallback, requestIdleCallback } from '#app/compat/idle-callback'
import { onNuxtReady } from '#app'
function useIntersectionObserver(options: IntersectionObserverInit) : {observe: ObserveFn} {
if (import.meta.server) { return {observe: () => () => {}}}
function useIntersectionObserver (options: IntersectionObserverInit): { observe: ObserveFn } {
if (import.meta.server) { return { observe: () => () => {} } }
let observer: IntersectionObserver | null = null
@ -30,7 +30,7 @@ function useIntersectionObserver(options: IntersectionObserverInit) : {observe:
}
const _observer = {
observe
observe,
}
return _observer
@ -100,12 +100,12 @@ export const createLazyNetworkClientPage = (componentLoader: Component) => {
const isIdle = ref(false)
let idleHandle: number | null = null
onMounted(() => {
onNuxtReady(()=>{
onNuxtReady(() => {
idleHandle = requestIdleCallback(() => {
isIdle.value = true
cancelIdleCallback(idleHandle as unknown as number)
idleHandle = null
}, attrs.loader ?? {timeout: 10000})
}, attrs.loader ?? { timeout: 10000 })
})
})
onBeforeUnmount(() => {