fix random error

This commit is contained in:
john 2025-05-20 10:47:21 +02:00
parent 538cdaf8a1
commit 7a6c379e79
3 changed files with 4 additions and 2 deletions

View file

@ -18,7 +18,7 @@ export function useIntersectionLoad(
) { ) {
const observerRef = useRef<IntersectionObserver | null>(null) const observerRef = useRef<IntersectionObserver | null>(null)
const loading = useRef(false) const loading = useRef(false)
const timeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null) const timeoutRef = useRef<Timeout | null>(null)
useEffect(() => { useEffect(() => {
const el = elementRef.current const el = elementRef.current

2
src/types.d.ts vendored
View file

@ -12,6 +12,8 @@ declare global {
interface Window { interface Window {
$femto: FemtoApp $femto: FemtoApp
} }
type Timeout = ReturnType<typeof setTimeout>
} }
export interface FemtoApp { export interface FemtoApp {

View file

@ -12,7 +12,7 @@ export function useRefreshSessionLoop(authService: AuthService) {
return return
} }
const timeouts: number[] = [] const timeouts: Timeout[] = []
timeouts.push( timeouts.push(
setTimeout(async function refreshUser() { setTimeout(async function refreshUser() {