Skip to content
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
4 changes: 1 addition & 3 deletions src/cssStyles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ type MyOptionType = {
value: string;
};

type IsMulti = false;

export function selectFieldStyle(theme: Theme): StylesConfig<MyOptionType, IsMulti> {
export function selectFieldStyle<IsMulti extends boolean, >(theme: Theme): StylesConfig<MyOptionType, IsMulti> {
return {
control: (provided, state) => ({
...provided,
Expand Down
9 changes: 9 additions & 0 deletions src/main/Cutting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { LuHourglass } from "react-icons/lu";
import { css } from "@emotion/react";
import VideoPlayers from "./VideoPlayers";
import VideoControls from "./VideoControls";
import { fetchMetadata, selectGetStatus as selectMetadataGetStatus } from "../redux/metadataSlice";

const Cutting: React.FC = () => {

Expand All @@ -45,6 +46,7 @@ const Cutting: React.FC = () => {
const theme = useTheme();
const errorReason = useAppSelector((state: { videoState: { errorReason: httpRequestState["errorReason"]; }; }) =>
state.videoState.errorReason);
const metadataGetStatus = useAppSelector(selectMetadataGetStatus);

// Try to fetch URL from external API
useEffect(() => {
Expand Down Expand Up @@ -76,6 +78,13 @@ const Cutting: React.FC = () => {
}
}, [videoURLStatus, dispatch, error, t, errorReason, duration]);

// Already try fetching Metadata to reduce wait time
useEffect(() => {
if (metadataGetStatus === "idle") {
dispatch(fetchMetadata());
}
}, [metadataGetStatus, dispatch]);

// Style
const cuttingStyle = css({
display: "flex",
Expand Down
Loading
Loading