1
0
mirror of https://github.com/mifi/lossless-cut.git synced 2024-11-22 02:12:30 +01:00

fix types

This commit is contained in:
Mikael Finstad 2024-11-02 02:03:39 +08:00
parent 4bf1231dfc
commit 20da7bbce9
No known key found for this signature in database
GPG Key ID: 25AB36E3E81CBC26
4 changed files with 4 additions and 4 deletions

View File

@ -473,7 +473,7 @@ function App() {
}), [allUserSettings, changeOutDir, effectiveExportMode, toggleCaptureFormat, toggleExportConfirmEnabled, toggleKeyframeCut, toggleSafeOutputFileName, toggleSimpleMode]); }), [allUserSettings, changeOutDir, effectiveExportMode, toggleCaptureFormat, toggleExportConfirmEnabled, toggleKeyframeCut, toggleSafeOutputFileName, toggleSimpleMode]);
const segColorsContext = useMemo(() => ({ const segColorsContext = useMemo(() => ({
getSegColor: (seg: SegmentColorIndex) => { getSegColor: (seg: SegmentColorIndex | undefined) => {
const color = getSegColor(seg); const color = getSegColor(seg);
return preferStrongColors ? color.desaturate(0.2) : color.desaturate(0.6); return preferStrongColors ? color.desaturate(0.2) : color.desaturate(0.6);
}, },

View File

@ -338,7 +338,7 @@ function SegmentList({
}, [apparentCutSegments.length, t, updateSegOrder]); }, [apparentCutSegments.length, t, updateSegOrder]);
function renderFooter() { 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 currentSegColor = getButtonColor(currentCutSeg);
const segAtCursorColor = getButtonColor(segmentAtCursor); const segAtCursorColor = getButtonColor(segmentAtCursor);

View File

@ -16,7 +16,7 @@ export type UserSettingsContextType = ReturnType<typeof useUserSettingsRoot> & {
} }
interface SegColorsContextType { interface SegColorsContextType {
getSegColor: (seg: SegmentColorIndex) => Color getSegColor: (seg: SegmentColorIndex | undefined) => Color
} }
export const UserSettingsContext = React.createContext<UserSettingsContextType | undefined>(undefined); export const UserSettingsContext = React.createContext<UserSettingsContextType | undefined>(undefined);

View File

@ -14,7 +14,7 @@ function getColor(n: number) {
} }
// eslint-disable-next-line import/prefer-default-export // eslint-disable-next-line import/prefer-default-export
export function getSegColor(seg: SegmentColorIndex) { export function getSegColor(seg: SegmentColorIndex | undefined) {
if (!seg) { if (!seg) {
return color({ return color({
h: 0, h: 0,