Skip to content

Commit

Permalink
Fix showing loading indicator when first loading a camera without pre…
Browse files Browse the repository at this point in the history
…views (#12064)
  • Loading branch information
NickM-27 committed Jun 19, 2024
1 parent c72d304 commit d01457e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/src/components/player/PreviewPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ function PreviewVideoPlayer({

const [firstLoad, setFirstLoad] = useState(true);

useEffect(() => {
if (cameraPreviews && cameraPreviews.length > 0) {
setFirstLoad(false);
}
}, [cameraPreviews]);

const [currentPreview, setCurrentPreview] = useState(initialPreview);

const onPreviewSeeked = useCallback(() => {
Expand Down

0 comments on commit d01457e

Please sign in to comment.