Skip to content

Commit

Permalink
Fix various eslint and typescript complaints
Browse files Browse the repository at this point in the history
Fixes various small issues that don't directly
impact functionality, but that eslint and typscript
complain about.
  • Loading branch information
Arnei committed Dec 19, 2024
1 parent cdaf937 commit be8d31d
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
5 changes: 4 additions & 1 deletion src/main/SubtitleEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,10 @@ const UploadButton: React.FC<{
try {
const text = e.target.result.toString();
const subtitleParsed = parseSubtitle(text);
dispatch(setSubtitle({ identifier: selectedId, subtitles: { cues: subtitleParsed, tags: subtitle.tags } }));
dispatch(setSubtitle({
identifier: selectedId,
subtitles: { cues: subtitleParsed, tags: subtitle.tags, deleted: false },
}));
} catch (e) {
console.error(e);
setErrorMessage(t("subtitles.uploadButton-error-parse"));
Expand Down
2 changes: 1 addition & 1 deletion src/main/SubtitleSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const SubtitleAddButton: React.FC<{
const id = values.selectedSubtitle;
const relatedSubtitle = subtitlesForDropdown.find(tag => tag.id === id);
const tags = relatedSubtitle ? relatedSubtitle.tags : [];
dispatch(setSubtitle({ identifier: id, subtitles: { cues: [], tags: tags, delete: false } }));
dispatch(setSubtitle({ identifier: id, subtitles: { cues: [], tags: tags, deleted: false } }));

// Reset
setIsPlusDisplay(true);
Expand Down
2 changes: 1 addition & 1 deletion src/main/TrackSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ const SelectButton: React.FC<selectButtonInterface> = ({ handler, text, Icon, to
}
};

const ref = React.useRef<HTMLDivElement>(null);
const ref = React.useRef<HTMLButtonElement>(null);

return (
<ThemedTooltip title={tooltip}>
Expand Down
15 changes: 11 additions & 4 deletions src/main/VideoPlayers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@ import React, { useState, useRef, useEffect, useImperativeHandle } from "react";

import { css } from "@emotion/react";

import { useAppDispatch, useAppSelector } from "../redux/store";
import { AppDispatch, useAppDispatch, useAppSelector } from "../redux/store";
import {
selectIsPlaying,
selectCurrentlyAtInSeconds,
setIsPlaying,
selectIsMuted,
selectVolume,
selectVideoURL,
selectVideoCount,
selectDurationInSeconds,
setPreviewTriggered,
Expand Down Expand Up @@ -39,7 +38,6 @@ import { useTheme } from "../themes";

import { backgroundBoxStyle } from "../cssStyles";
import { BaseReactPlayerProps } from "react-player/base";
import { AsyncThunkConfig } from "@reduxjs/toolkit/dist/createAsyncThunk";
import { ErrorBox } from "@opencast/appkit";

const VideoPlayers: React.FC<{
Expand Down Expand Up @@ -133,7 +131,16 @@ interface VideoPlayerProps {
setPreviewTriggered: ActionCreatorWithPayload<boolean, string>,
setClickTriggered: ActionCreatorWithPayload<boolean, string>,
setJumpTriggered: ActionCreatorWithPayload<boolean, string>,
setCurrentlyAt: ActionCreatorWithPayload<number, string> | AsyncThunk<void, number, AsyncThunkConfig>,
setCurrentlyAt: ActionCreatorWithPayload<number, string> | AsyncThunk<void, number, {
state: RootState;
dispatch: AppDispatch;
extra?: unknown;
rejectValue?: unknown;
serializedErrorType?: unknown;
pendingMeta?: unknown;
fulfilledMeta?: unknown;
rejectedMeta?: unknown;
}>,
setAspectRatio: ActionCreatorWithPayload<{ dataKey: number; } & { width: number, height: number; }, string>,
}

Expand Down
4 changes: 1 addition & 3 deletions src/main/WorkflowSelection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { useAppDispatch, useAppSelector } from "../redux/store";
import { selectWorkflows, setSelectedWorkflowIndex } from "../redux/videoSlice";

import { PageButton } from "./Finish";
import { LuChevronLeft, LuDatabase } from "react-icons/lu";
import { LuChevronLeft } from "react-icons/lu";
import { selectStatus as saveSelectStatus, selectError as saveSelectError } from "../redux/workflowPostSlice";
import { httpRequestState, Workflow } from "../types";
import { SaveButton } from "./Save";
Expand Down Expand Up @@ -135,7 +135,6 @@ const WorkflowSelection: React.FC = () => {
</Trans>,
false,
<SaveButton
basicIcon={LuDatabase}
isTransitionToEnd={true}
text={t("workflowSelection.startProcessing-button")}
/>,
Expand All @@ -152,7 +151,6 @@ const WorkflowSelection: React.FC = () => {
</div>,
true,
<SaveButton
basicIcon={LuDatabase}
isTransitionToEnd={true}
text={t("workflowSelection.startProcessing-button")}
/>,
Expand Down

0 comments on commit be8d31d

Please sign in to comment.