diff --git a/src/app/components/ActivityTracker.tsx b/src/app/components/ActivityTracker.tsx index 039bcff..b5ebad5 100644 --- a/src/app/components/ActivityTracker.tsx +++ b/src/app/components/ActivityTracker.tsx @@ -3,36 +3,12 @@ import { useEffect, useRef, useCallback } from 'react'; import { tokenLifeExtension } from '@/app/actions/auth'; -import { usePathname, useSearchParams } from 'next/navigation'; -import { removeUserFile } from '@/app/actions/fileEntity'; export default function ActivityTracker() { const lastRefreshTime = useRef(Date.now()); const activityTimeoutRef = useRef(null); const isRefreshing = useRef(false); - - const pathname = usePathname(); - const searchParams = useSearchParams(); - - useEffect(() => { - const selectedId = document.cookie - .split('; ') - .find(row => row.startsWith('searchedFileId=')) - ?.split('=')[1]; - - const handleCookie = async () => { - if (selectedId) { - await removeUserFile(selectedId, 1); - document.cookie = 'searchedFileId=; path=/; max-age=0'; - } - }; - - if (selectedId) { - handleCookie(); - } - }, [pathname, searchParams]); - // Debounce функция const debounce = useCallback((func: () => void, delay: number) => { if (activityTimeoutRef.current) {