From ae691c30b4b576e8bfd5184871dcf90d00595227 Mon Sep 17 00:00:00 2001 From: Nicolas Mowen Date: Mon, 12 Aug 2024 13:19:02 -0600 Subject: [PATCH] Remove check --- web/src/views/events/RecordingView.tsx | 270 ++++++++++++------------- 1 file changed, 126 insertions(+), 144 deletions(-) diff --git a/web/src/views/events/RecordingView.tsx b/web/src/views/events/RecordingView.tsx index fb99ff794..842770171 100644 --- a/web/src/views/events/RecordingView.tsx +++ b/web/src/views/events/RecordingView.tsx @@ -108,7 +108,7 @@ export function RecordingView({ return chunk.after <= startTime && chunk.before >= startTime; }), ); - const currentTimeRange = useMemo( + const currentTimeRange = useMemo( () => chunkedTimeRange[selectedRangeIdx] ?? chunkedTimeRange[chunkedTimeRange.length - 1], @@ -174,10 +174,6 @@ export function RecordingView({ ); useEffect(() => { - if (!currentTimeRange) { - return; - } - if (scrubbing || exportRange) { if ( currentTime > currentTimeRange.before + 60 || @@ -221,10 +217,6 @@ export function RecordingView({ ); useEffect(() => { - if (!currentTimeRange) { - return; - } - if (!scrubbing) { if (Math.abs(currentTime - playerTime) > 10) { if ( @@ -486,153 +478,143 @@ export function RecordingView({ - {currentTimeRange ? ( +
-
{ + setPlayerTime(timestamp); + setCurrentTime(timestamp); + Object.values(previewRefs.current ?? {}).forEach((prev) => + prev.scrubToTimestamp(Math.floor(timestamp)), + ); }} - > - { - setPlayerTime(timestamp); - setCurrentTime(timestamp); - Object.values(previewRefs.current ?? {}).forEach((prev) => - prev.scrubToTimestamp(Math.floor(timestamp)), - ); - }} - onClipEnded={onClipEnded} - onControllerReady={(controller) => { - mainControllerRef.current = controller; - }} - isScrubbing={scrubbing || exportMode == "timeline"} - setFullResolution={setFullResolution} - toggleFullscreen={toggleFullscreen} - containerRef={mainLayoutRef} - /> -
- {isDesktop && ( -
-
- {allCameras.map((cam) => { - if (cam == mainCamera || cam == "birdseye") { - return; - } - - return ( -
- { - previewRefs.current[cam] = controller; - controller.scrubToTimestamp(startTime); - }} - onClick={() => onSelectCamera(cam)} - /> -
- ); - })} -
-
- )} + onClipEnded={onClipEnded} + onControllerReady={(controller) => { + mainControllerRef.current = controller; + }} + isScrubbing={scrubbing || exportMode == "timeline"} + setFullResolution={setFullResolution} + toggleFullscreen={toggleFullscreen} + containerRef={mainLayoutRef} + />
-
- -
- ) : ( -
-
- - No recordings or previews found for this time + {isDesktop && ( +
+
+ {allCameras.map((cam) => { + if (cam == mainCamera || cam == "birdseye") { + return; + } + + return ( +
+ { + previewRefs.current[cam] = controller; + controller.scrubToTimestamp(startTime); + }} + onClick={() => onSelectCamera(cam)} + /> +
+ ); + })} +
+
+ )}
- )} + +
); }