checking for parsedResumes
This commit is contained in:
parent
206527fa0d
commit
52b074cd05
@ -40,16 +40,23 @@ export default function ResumeUploadForm({ vacancyId, vacancyTitle, onSuccess }:
|
|||||||
|
|
||||||
const hasPendingResumes = pendingResumes.length > 0
|
const hasPendingResumes = pendingResumes.length > 0
|
||||||
|
|
||||||
|
// Находим парсенные резюме
|
||||||
|
const parsedResumes = existingResumes?.filter(resume =>
|
||||||
|
resume.status === 'parsed'
|
||||||
|
) || []
|
||||||
|
|
||||||
|
const hasParsedResumes = parsedResumes.length > 0
|
||||||
|
|
||||||
// Автообновление для непарсенных резюме
|
// Автообновление для непарсенных резюме
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (hasPendingResumes) {
|
if (hasPendingResumes || hasParsedResumes) {
|
||||||
const interval = setInterval(() => {
|
const interval = setInterval(() => {
|
||||||
refetch()
|
refetch()
|
||||||
}, 3000) // 3 секунды
|
}, 3000) // 3 секунды
|
||||||
|
|
||||||
return () => clearInterval(interval)
|
return () => clearInterval(interval)
|
||||||
}
|
}
|
||||||
}, [hasPendingResumes, refetch])
|
}, [hasPendingResumes, hasParsedResumes, refetch])
|
||||||
|
|
||||||
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
const handleInputChange = (e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>) => {
|
||||||
const { name, value } = e.target
|
const { name, value } = e.target
|
||||||
|
Loading…
Reference in New Issue
Block a user