From be8d31d90870c70f34bbcd3c040cfe501cc1e475 Mon Sep 17 00:00:00 2001 From: Arnei Date: Thu, 19 Dec 2024 10:35:56 +0100 Subject: [PATCH] Fix various eslint and typescript complaints Fixes various small issues that don't directly impact functionality, but that eslint and typscript complain about. --- src/main/SubtitleEditor.tsx | 5 ++++- src/main/SubtitleSelect.tsx | 2 +- src/main/TrackSelection.tsx | 2 +- src/main/VideoPlayers.tsx | 15 +++++++++++---- src/main/WorkflowSelection.tsx | 4 +--- 5 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/main/SubtitleEditor.tsx b/src/main/SubtitleEditor.tsx index 07a957aa3..c0d946381 100644 --- a/src/main/SubtitleEditor.tsx +++ b/src/main/SubtitleEditor.tsx @@ -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")); diff --git a/src/main/SubtitleSelect.tsx b/src/main/SubtitleSelect.tsx index 267092862..a1f9ab5a6 100644 --- a/src/main/SubtitleSelect.tsx +++ b/src/main/SubtitleSelect.tsx @@ -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); diff --git a/src/main/TrackSelection.tsx b/src/main/TrackSelection.tsx index 7be0c65b2..2eb8330fb 100644 --- a/src/main/TrackSelection.tsx +++ b/src/main/TrackSelection.tsx @@ -211,7 +211,7 @@ const SelectButton: React.FC = ({ handler, text, Icon, to } }; - const ref = React.useRef(null); + const ref = React.useRef(null); return ( diff --git a/src/main/VideoPlayers.tsx b/src/main/VideoPlayers.tsx index d16f03ca6..dea406b94 100644 --- a/src/main/VideoPlayers.tsx +++ b/src/main/VideoPlayers.tsx @@ -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, @@ -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<{ @@ -133,7 +131,16 @@ interface VideoPlayerProps { setPreviewTriggered: ActionCreatorWithPayload, setClickTriggered: ActionCreatorWithPayload, setJumpTriggered: ActionCreatorWithPayload, - setCurrentlyAt: ActionCreatorWithPayload | AsyncThunk, + setCurrentlyAt: ActionCreatorWithPayload | AsyncThunk, setAspectRatio: ActionCreatorWithPayload<{ dataKey: number; } & { width: number, height: number; }, string>, } diff --git a/src/main/WorkflowSelection.tsx b/src/main/WorkflowSelection.tsx index 14d5922ad..fe8774e26 100644 --- a/src/main/WorkflowSelection.tsx +++ b/src/main/WorkflowSelection.tsx @@ -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"; @@ -135,7 +135,6 @@ const WorkflowSelection: React.FC = () => { , false, , @@ -152,7 +151,6 @@ const WorkflowSelection: React.FC = () => { , true, ,