|
|
|
|
@ -75,10 +75,10 @@ export const useMatchPage = () => { |
|
|
|
|
matchPlaylists, |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
const getMatchViewDuration = () => (getViewMatchDuration({ |
|
|
|
|
const getMatchViewDuration = (id: number) => (getViewMatchDuration({ |
|
|
|
|
matchId, |
|
|
|
|
sportType, |
|
|
|
|
userId: Number(userInfo?.email), |
|
|
|
|
userId: id, |
|
|
|
|
}).then(({ |
|
|
|
|
duration, |
|
|
|
|
error, |
|
|
|
|
@ -106,18 +106,18 @@ export const useMatchPage = () => { |
|
|
|
|
matchId]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (user) return |
|
|
|
|
if (user || !userInfo?.email) return |
|
|
|
|
|
|
|
|
|
const counter = setInterval( |
|
|
|
|
() => getMatchViewDuration(), 1000 * 30, |
|
|
|
|
() => getMatchViewDuration(Number(userInfo?.email)), 1000 * 30, |
|
|
|
|
) |
|
|
|
|
// eslint-disable-next-line
|
|
|
|
|
return () => clearInterval(counter) |
|
|
|
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
|
|
|
}, [ |
|
|
|
|
user, |
|
|
|
|
sportType, |
|
|
|
|
matchId, |
|
|
|
|
userInfo, |
|
|
|
|
]) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
|