diff --git a/frontend/src/pages/Episodes/index.tsx b/frontend/src/pages/Episodes/index.tsx index 12c0f7c67..1bbf365c3 100644 --- a/frontend/src/pages/Episodes/index.tsx +++ b/frontend/src/pages/Episodes/index.tsx @@ -9,10 +9,10 @@ import { Toolbox } from "@/components"; import { QueryOverlay } from "@/components/async"; import { ItemEditModal } from "@/components/forms/ItemEditForm"; import { SeriesUploadModal } from "@/components/forms/SeriesUploadForm"; -import File, { FileOverlay } from "@/components/inputs/File"; +import File, { FileOverlay, FileProps } from "@/components/inputs/File"; import { SubtitleToolsModal } from "@/components/modals"; import { useModals } from "@/modules/modals"; -import { task, TaskGroup } from "@/modules/task"; +import { notification, task, TaskGroup } from "@/modules/task"; import ItemOverview from "@/pages/views/ItemOverview"; import { useLanguageProfileBy } from "@/utilities/languages"; import { @@ -26,6 +26,7 @@ import { } from "@fortawesome/free-solid-svg-icons"; import { Container, Group, Stack } from "@mantine/core"; import { useDocumentTitle } from "@mantine/hooks"; +import { showNotification } from "@mantine/notifications"; import { FunctionComponent, useCallback, useMemo, useRef } from "react"; import { Navigate, useParams } from "react-router-dom"; import Table from "./table"; @@ -73,11 +74,24 @@ const SeriesEpisodesView: FunctionComponent = () => { files, series, }); + } else { + showNotification( + notification.warn( + "Cannot Upload Files", + "series or language profile is not ready" + ) + ); } }, [modals, profile, series] ); + const onReject = useCallback>((rejections) => { + showNotification( + notification.warn("Cannot Upload Files", "Some files are invalid") + ); + }, []); + useDocumentTitle(`${series?.title ?? "Unknown Series"} - Bazarr (Series)`); if (isNaN(id) || (isFetched && !series)) { @@ -87,6 +101,7 @@ const SeriesEpisodesView: FunctionComponent = () => { return ( + {/* TODO: Still have some bugs. Handle it later */} { {/* A workaround to allow click to upload files */} diff --git a/frontend/src/types/utilities.d.ts b/frontend/src/types/utilities.d.ts index b6b63f6a7..ef31f3e7c 100644 --- a/frontend/src/types/utilities.d.ts +++ b/frontend/src/types/utilities.d.ts @@ -24,5 +24,7 @@ interface DataWrapperWithTotal { type Override = T & Omit; +type Sure = Exclude; + // eslint-disable-next-line @typescript-eslint/no-explicit-any type GenericFunction = (...args: any[]) => T;