diff --git a/src/renderer/src/App.tsx b/src/renderer/src/App.tsx index 1364f0ac..ebedba17 100644 --- a/src/renderer/src/App.tsx +++ b/src/renderer/src/App.tsx @@ -473,7 +473,7 @@ function App() { }), [allUserSettings, changeOutDir, effectiveExportMode, toggleCaptureFormat, toggleExportConfirmEnabled, toggleKeyframeCut, toggleSafeOutputFileName, toggleSimpleMode]); const segColorsContext = useMemo(() => ({ - getSegColor: (seg: SegmentColorIndex) => { + getSegColor: (seg: SegmentColorIndex | undefined) => { const color = getSegColor(seg); return preferStrongColors ? color.desaturate(0.2) : color.desaturate(0.6); }, diff --git a/src/renderer/src/SegmentList.tsx b/src/renderer/src/SegmentList.tsx index 15f2be9d..b9907e33 100644 --- a/src/renderer/src/SegmentList.tsx +++ b/src/renderer/src/SegmentList.tsx @@ -338,7 +338,7 @@ function SegmentList({ }, [apparentCutSegments.length, t, updateSegOrder]); function renderFooter() { - const getButtonColor = (seg) => getSegColor(seg).desaturate(0.3).lightness(darkMode ? 45 : 55).string(); + const getButtonColor = (seg: StateSegment | undefined) => getSegColor(seg).desaturate(0.3).lightness(darkMode ? 45 : 55).string(); const currentSegColor = getButtonColor(currentCutSeg); const segAtCursorColor = getButtonColor(segmentAtCursor); diff --git a/src/renderer/src/contexts.ts b/src/renderer/src/contexts.ts index c9183df2..7afbd8ea 100644 --- a/src/renderer/src/contexts.ts +++ b/src/renderer/src/contexts.ts @@ -16,7 +16,7 @@ export type UserSettingsContextType = ReturnType & { } interface SegColorsContextType { - getSegColor: (seg: SegmentColorIndex) => Color + getSegColor: (seg: SegmentColorIndex | undefined) => Color } export const UserSettingsContext = React.createContext(undefined); diff --git a/src/renderer/src/util/colors.ts b/src/renderer/src/util/colors.ts index f0037fc1..a0f99630 100644 --- a/src/renderer/src/util/colors.ts +++ b/src/renderer/src/util/colors.ts @@ -14,7 +14,7 @@ function getColor(n: number) { } // eslint-disable-next-line import/prefer-default-export -export function getSegColor(seg: SegmentColorIndex) { +export function getSegColor(seg: SegmentColorIndex | undefined) { if (!seg) { return color({ h: 0,