Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various eslint and typescript complaints #1522

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading