fix: remove useMemo hook after early returns in QCList
The useMemo hook was placed after early returns (isLoading, error), which violates React's rules of hooks. Hooks must be called unconditionally on every render. Replaced with simple inline computation since the operation is cheap. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
c512bdc184
commit
9436aa4c6b
1 changed files with 4 additions and 6 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { useState, useMemo } from 'react';
|
||||
import { useState } from 'react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { useJobs, useApproveEnglish, useRejectJob, useBulkApproveJobs } from '../../hooks/useJob';
|
||||
import { StatusBadge } from '../../components/StatusBadge';
|
||||
|
|
@ -49,11 +49,9 @@ export function QCList() {
|
|||
const jobs = jobsResponse?.jobs || [];
|
||||
|
||||
// Check if any selected job has accessible_video_mp4 requested
|
||||
const anySelectedHasAccessibleVideo = useMemo(() => {
|
||||
return jobs.some(job =>
|
||||
selectedJobs.has(job.id) && job.requested_outputs.accessible_video_mp4
|
||||
);
|
||||
}, [jobs, selectedJobs]);
|
||||
const anySelectedHasAccessibleVideo = jobs.some(job =>
|
||||
selectedJobs.has(job.id) && job.requested_outputs.accessible_video_mp4
|
||||
);
|
||||
|
||||
const toggleJobSelection = (jobId: string) => {
|
||||
const newSelected = new Set(selectedJobs);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue