mirror of
https://github.com/spacedriveapp/spacedrive.git
synced 2026-04-21 06:59:17 -04:00
* d * wip * Nit: margin and padding tweak * UI design tweaks * Update Job.tsx * Improve UI * [WIP] - Refactor job manager * remove invalidate explorer event on thumb generation. the event above performs atomic updates on the front end when new thumbnails are generated, now just need to make that work * prettier formatting + removed unused imports * UI tweaks * progress bar width adjustment * tweaks * fix em * fix thumbnail generation * fix progress bar * fix time --------- Co-authored-by: Jamie Pine <ijamespine@me.com> Co-authored-by: Brendan Allan <brendonovich@outlook.com> Co-authored-by: Oscar Beaumont <oscar@otbeaumont.me>
24 lines
559 B
TypeScript
24 lines
559 B
TypeScript
import { useMemo } from 'react';
|
|
import { JobReport } from '@sd/client';
|
|
|
|
export function useOrphanJobs(jobs: JobReport[], runningJobs: JobReport[]) {
|
|
const runningJobsNoChildren = useMemo(() => {
|
|
const singleRunningJobs = [];
|
|
|
|
for (const job of jobs) {
|
|
for (const runningJob of runningJobs) {
|
|
if (
|
|
job.parent_id !== runningJob.id &&
|
|
job.id !== runningJob.id &&
|
|
job.id !== job.id
|
|
) {
|
|
singleRunningJobs.push(runningJob);
|
|
}
|
|
}
|
|
}
|
|
return singleRunningJobs;
|
|
}, [jobs, runningJobs]);
|
|
|
|
return runningJobsNoChildren;
|
|
}
|