mirror of
https://github.com/mifi/lossless-cut.git
synced 2024-11-24 03:12:41 +01:00
fix types
This commit is contained in:
parent
4bf1231dfc
commit
20da7bbce9
@ -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);
|
||||
},
|
||||
|
@ -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);
|
||||
|
||||
|
@ -16,7 +16,7 @@ export type UserSettingsContextType = ReturnType<typeof useUserSettingsRoot> & {
|
||||
}
|
||||
|
||||
interface SegColorsContextType {
|
||||
getSegColor: (seg: SegmentColorIndex) => Color
|
||||
getSegColor: (seg: SegmentColorIndex | undefined) => Color
|
||||
}
|
||||
|
||||
export const UserSettingsContext = React.createContext<UserSettingsContextType | undefined>(undefined);
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user