From e253ae3d209a7a659a42675009be4b30b8f4c691 Mon Sep 17 00:00:00 2001 From: glax Date: Wed, 18 Jun 2025 19:04:17 +0200 Subject: [PATCH] Code-Typos, Formatting, redundant statements --- README.md | 6 +++--- tranga-website/src/Components/MangaPopup.tsx | 4 ++-- tranga-website/src/api/Job.tsx | 8 ++++---- tranga-website/src/api/Manga.tsx | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 97fa0e9..ba62a1e 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,9 @@ ## Screenshots -|![Main Page](Screenshots/Screenshot%202025-06-17%20at%2001-15-08%20Tranga.png)|![Settings](Screenshots/Screenshot%202025-06-17%20at%2001-15-23%20Tranga.png)|![Search Empty](Screenshots/Screenshot%202025-06-17%20at%2001-15-36%20Tranga.png) -|---|---|---| -|![Search Results](Screenshots/Screenshot%202025-06-17%20at%2001-16-32%20Tranga.png)|![Manga Popup](Screenshots/Screenshot%202025-06-17%20at%2001-16-43%20Tranga.png)|![Jobs Drawer](Screenshots/Screenshot%202025-06-17%20at%2001-17-37%20Tranga.png) +| ![Main Page](Screenshots/Screenshot%202025-06-17%20at%2001-15-08%20Tranga.png) | ![Settings](Screenshots/Screenshot%202025-06-17%20at%2001-15-23%20Tranga.png) | ![Search Empty](Screenshots/Screenshot%202025-06-17%20at%2001-15-36%20Tranga.png) | +|-------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|-----------------------------------------------------------------------------------| +| ![Search Results](Screenshots/Screenshot%202025-06-17%20at%2001-16-32%20Tranga.png) | ![Manga Popup](Screenshots/Screenshot%202025-06-17%20at%2001-16-43%20Tranga.png) | ![Jobs Drawer](Screenshots/Screenshot%202025-06-17%20at%2001-17-37%20Tranga.png) | ## About The Project diff --git a/tranga-website/src/Components/MangaPopup.tsx b/tranga-website/src/Components/MangaPopup.tsx index 08a9a95..2e65fd5 100644 --- a/tranga-website/src/Components/MangaPopup.tsx +++ b/tranga-website/src/Components/MangaPopup.tsx @@ -116,7 +116,7 @@ export default function MangaPopup({manga, open, setOpen, children} : {manga: IM }, [manga, apiUri]); const [updatingThreshold, setUpdatingThreshold] = useState(false); - const updateIgnoreThreshhold = useCallback((value: number) => { + const updateIgnoreThreshold = useCallback((value: number) => { if(manga == null) return; setUpdatingThreshold(true); @@ -176,7 +176,7 @@ export default function MangaPopup({manga, open, setOpen, children} : {manga: IM } sx={{width:"min-content"}} size={"md"} - onChange={(e) => updateIgnoreThreshhold(e.currentTarget.valueAsNumber)} + onChange={(e) => updateIgnoreThreshold(e.currentTarget.valueAsNumber)} /> {children} diff --git a/tranga-website/src/api/Job.tsx b/tranga-website/src/api/Job.tsx index f318470..db1874e 100644 --- a/tranga-website/src/api/Job.tsx +++ b/tranga-website/src/api/Job.tsx @@ -14,22 +14,22 @@ export const GetJobsWithIds = async (apiUri: string, jobIds: string[]) : Promise } export const GetJobsInState = async (apiUri: string, state: JobState) : Promise => { - if(state == null || state == undefined) + if(state == null) return Promise.reject("state was not provided"); return await getData(`${apiUri}/v2/Job/State/${state}`) as Promise; } export const GetJobsWithType = async (apiUri: string, jobType: JobType) : Promise => { - if(jobType == null || jobType == undefined) { + if(jobType == null) { return Promise.reject("jobType was not provided"); } return await getData(`${apiUri}/v2/Job/Type/${jobType}`) as Promise; } export const GetJobsOfTypeAndWithState = async (apiUri: string, jobType: JobType, state: JobState) : Promise => { - if(jobType == null || jobType == undefined) + if(jobType == null) return Promise.reject("jobType was not provided"); - if(state == null || state == undefined) + if(state == null) return Promise.reject("state was not provided"); return await getData(`${apiUri}/v2/Job/TypeAndState/${jobType}/${state}`) as Promise; } diff --git a/tranga-website/src/api/Manga.tsx b/tranga-website/src/api/Manga.tsx index 7baf77b..92bdc08 100644 --- a/tranga-website/src/api/Manga.tsx +++ b/tranga-website/src/api/Manga.tsx @@ -29,13 +29,13 @@ export const DeleteManga = async (apiUri: string, mangaId: string) : Promise { - if(ref == null || ref == undefined || mangaId === DefaultManga.mangaId) + if(ref == null || mangaId === DefaultManga.mangaId) return "/blahaj.png"; return `${apiUri}/v2/Manga/${mangaId}/Cover?width=${ref.clientWidth}&height=${ref.clientHeight}`; } export const GetChapters = async (apiUri: string, mangaId: string) : Promise => { - if(mangaId === undefined || mangaId === null || mangaId.length < 1) + if(mangaId === null || mangaId.length < 1) return Promise.reject("mangaId was not provided"); if(mangaId === DefaultManga.mangaId) return Promise.reject("Default Manga was requested");