From 0882d1afd3657fc1197b8554d3bee54054b980b3 Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Sat, 21 Nov 2020 12:42:17 +0100 Subject: [PATCH] improvement --- src/App.jsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 09c28816..ef38ce97 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -330,11 +330,7 @@ const App = memo(() => { end: getSegApparentEnd(cutSegment), })), [cutSegments, getSegApparentEnd]); - const invalidSegUuids = apparentCutSegments - .filter(cutSegment => cutSegment.start >= cutSegment.end) - .map(cutSegment => cutSegment.uuid); - - const haveInvalidSegs = invalidSegUuids.length > 0; + const haveInvalidSegs = useMemo(() => apparentCutSegments.filter(cutSegment => cutSegment.start >= cutSegment.end).length > 0, [apparentCutSegments]); const currentSegIndexSafe = Math.min(currentSegIndex, cutSegments.length - 1); const currentCutSeg = useMemo(() => cutSegments[currentSegIndexSafe], [currentSegIndexSafe, cutSegments]);