From c2e504ccc6c315b8ecba3de25a89e0682d2b6f6d Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Thu, 15 Aug 2024 22:41:25 +0200 Subject: [PATCH] err also if all segments match expr #2059 --- src/renderer/src/components/Settings.tsx | 4 ++-- src/renderer/src/hooks/useSegments.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/Settings.tsx b/src/renderer/src/components/Settings.tsx index 3881d400..b73171c7 100644 --- a/src/renderer/src/components/Settings.tsx +++ b/src/renderer/src/components/Settings.tsx @@ -1,4 +1,4 @@ -import { CSSProperties, ChangeEventHandler, memo, useCallback, useMemo, useState } from 'react'; +import { CSSProperties, ChangeEventHandler, TdHTMLAttributes, memo, useCallback, useMemo, useState } from 'react'; import { FaYinYang, FaKeyboard } from 'react-icons/fa'; import { GlobeIcon, CleanIcon, CogIcon, Button, NumericalIcon, FolderCloseIcon, DocumentIcon, TimeIcon, CrossIcon } from 'evergreen-ui'; import { useTranslation } from 'react-i18next'; @@ -30,7 +30,7 @@ const Row = (props: HTMLMotionProps<'tr'>) => ( /> ); // eslint-disable-next-line react/jsx-props-no-spreading -const KeyCell = (props) => ; +const KeyCell = (props: TdHTMLAttributes) => ; const Header = ({ title }: { title: string }) => ( diff --git a/src/renderer/src/hooks/useSegments.ts b/src/renderer/src/hooks/useSegments.ts index b90611fb..34370550 100644 --- a/src/renderer/src/hooks/useSegments.ts +++ b/src/renderer/src/hooks/useSegments.ts @@ -497,6 +497,7 @@ function useSegments({ filePath, workingRef, setWorking, setCutProgress, videoSt if (v.trim().length === 0) return i18n.t('Please enter a JavaScript expression.'); const segments = await getSegmentsToEnable(v); if (segments.length === 0) return i18n.t('No segments match this expression.'); + if (segments.length === cutSegments.length) return i18n.t('All segments match this expression.'); return undefined; } catch (err) { if (err instanceof Error) {