diff --git a/src/features/MatchPage/store/hooks/index.tsx b/src/features/MatchPage/store/hooks/index.tsx index 1cc3145c..e84766a5 100644 --- a/src/features/MatchPage/store/hooks/index.tsx +++ b/src/features/MatchPage/store/hooks/index.tsx @@ -22,27 +22,6 @@ import { useMatchData } from './useMatchData' import { useFiltersPopup } from './useFitersPopup' import { useTabEvents } from './useTabEvents' -import type { Playlists } from '../../types' - -const addScoresFromPlaylists = ( - profile: MatchInfo, - playlists: Playlists, -): MatchInfo => ( - profile - ? { - ...profile, - team1: { - ...profile?.team1, - score: playlists.score1, - }, - team2: { - ...profile?.team2, - score: playlists.score2, - }, - } - : null -) - export const useMatchPage = () => { const [matchProfile, setMatchProfile] = useState(null) const { profileId: matchId, sportType } = usePageParams() @@ -91,10 +70,8 @@ export const useMatchPage = () => { setFullMatchPlaylistDuration, } = useMatchData(matchProfile) - const profile = useMemo( - () => addScoresFromPlaylists(matchProfile, matchPlaylists), - [matchProfile, matchPlaylists], - ) + const profile = matchProfile + const isStarted = useMemo(() => ( profile?.date ? parseDate(profile.date) < new Date() diff --git a/src/requests/getMatches/types.tsx b/src/requests/getMatches/types.tsx index a54cc826..b7e3ac03 100644 --- a/src/requests/getMatches/types.tsx +++ b/src/requests/getMatches/types.tsx @@ -11,7 +11,7 @@ type Team = { id: number, name_eng: string, name_rus: string, - score?: number, + score?: number | null, } export type SportInfo = {