From 0697dbf07262cac40f7ee7f7377c521b1ada3c20 Mon Sep 17 00:00:00 2001 From: Ruslan Khayrullin Date: Tue, 23 May 2023 15:58:45 +0500 Subject: [PATCH] fix: match stats bugfix --- src/features/StreamPlayer/hooks/index.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/StreamPlayer/hooks/index.tsx b/src/features/StreamPlayer/hooks/index.tsx index da9752e2..b70c5f4a 100644 --- a/src/features/StreamPlayer/hooks/index.tsx +++ b/src/features/StreamPlayer/hooks/index.tsx @@ -629,7 +629,7 @@ export const useVideoPlayer = ({ // ведем статистику просмотра матча const { start: startCollectingStats, stop: stopCollectingStats } = useInterval({ - callback: () => { + callback: useCallback(() => { if (timeForStatistics.current !== 0) { saveMatchStats({ matchId: profileId, @@ -637,7 +637,7 @@ export const useVideoPlayer = ({ sportType, }) } - }, + }, [profileId, sportType]), intervalDuration: VIEW_INTERVAL_MS, startImmediate: false, })