Skip to content

Commit

Permalink
dont reset video player when reportID was -1
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardoj committed Aug 6, 2024
1 parent 6bd2921 commit 91ed245
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/VideoPlayerContexts/PlaybackContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ function PlaybackContextProvider({children}: ChildrenProps) {
}, [stopVideo, unloadVideo]);

useEffect(() => {
if (!currentReportID || !prevCurrentReportID) {
if (!currentReportID || !prevCurrentReportID || currentReportID === '-1' || prevCurrentReportID === '-1') {
return;
}
resetVideoPlayerData();
}, [currentReportID, resetVideoPlayerData]);
}, [currentReportID, prevCurrentReportID, resetVideoPlayerData]);

const contextValue = useMemo(
() => ({
Expand Down

0 comments on commit 91ed245

Please sign in to comment.