Skip to content

Commit

Permalink
Minor fixes (#893)
Browse files Browse the repository at this point in the history
* fix Ts().state is null

* fix Cannot read properties of undefined (reading 'ID')
  • Loading branch information
hidden4003 authored May 4, 2024
1 parent 5f873af commit efe721e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const MultiplesUtil = () => {
if (!selectedEpisode) return null;

const file = selectedEpisode.Files!.find(item => item.ID === toNumber(id))!;
if (!file) return null;
if (option === 'delete') return deleteFile({ fileId: file.ID, removeFolder: false });
if (option === 'variation' && !file.IsVariation) return markVariation({ fileId: file.ID, variation: true });
if (option === 'keep' && file.IsVariation) return markVariation({ fileId: file.ID, variation: false });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const AnimeSelectPanel = (

function LinkFilesTab() {
const navigate = useNavigate();
const { selectedRows } = useLocation().state as { selectedRows: FileType[] };
const { selectedRows } = (useLocation().state ?? []) as { selectedRows: FileType[] };
const [{ createdNewSeries, isLinking, isLinkingRunning }, setLoading] = useState({
isLinking: false,
isLinkingRunning: false,
Expand Down

0 comments on commit efe721e

Please sign in to comment.