diff --git a/tranga-website/src/Components/MangaList.tsx b/tranga-website/src/Components/MangaList.tsx index f27b935..4b26a8c 100644 --- a/tranga-website/src/Components/MangaList.tsx +++ b/tranga-website/src/Components/MangaList.tsx @@ -1,7 +1,7 @@ import {Badge, Box, Button, Card, CardContent, CardCover, Stack, Typography} from "@mui/joy"; import {Dispatch, SetStateAction, useCallback, useContext, useEffect, useState} from "react"; import {ApiUriContext} from "../api/fetchApi.tsx"; -import {DeleteJob, GetJobsWithType} from "../api/Job.tsx"; +import {DeleteJob, GetJobsWithType, StartJob} from "../api/Job.tsx"; import {JobType} from "../api/types/Jobs/IJob.ts"; import IDownloadAvailableChaptersJob from "../api/types/Jobs/IDownloadAvailableChaptersJob.ts"; import {CardHeight, CardWidth, MangaFromId} from "./Manga.tsx"; @@ -23,6 +23,10 @@ export default function MangaList({connected, setShowSearch}: {connected: boolea DeleteJob(apiUri, jobId).finally(() => getJobList()); },[apiUri]); + const startJob = useCallback((jobId: string) => { + StartJob(apiUri, jobId, true).finally(() => getJobList()); + },[apiUri]); + useEffect(() => { getJobList(); }, [apiUri]); @@ -69,6 +73,7 @@ export default function MangaList({connected, setShowSearch}: {connected: boolea {jobList?.map((job) => ( + ))}