diff --git a/ondeck/src/components/clients/client-detail.tsx b/ondeck/src/components/clients/client-detail.tsx index 4459dce..df1431a 100644 --- a/ondeck/src/components/clients/client-detail.tsx +++ b/ondeck/src/components/clients/client-detail.tsx @@ -112,6 +112,16 @@ export function ClientDetail({ client, designations, policyGroups = [], allPolic refreshTasks(next) } + const handleToggleCompleted = () => { + const next = !showCompleted + setShowCompleted(next) + // The default (non-archived) task fetch only includes completed/cancelled/NA tasks + // from the last 7 days — anything older needs the archived fetch to actually load. + // Revert to the filtered fetch when turning it back off (unless Show Archived is + // separately on) so dead-policy tasks pulled in by the archived fetch don't leak in. + if (!showArchivedTasks) refreshTasks(next) + } + // Assignments state const [allUsers, setAllUsers] = useState([]) const [claimsUsers, setClaimsUsers] = useState([]) @@ -647,7 +657,7 @@ export function ClientDetail({ client, designations, policyGroups = [], allPolic {/* Show completed toggle */}