From 9e82c6b3891a8524085e5da6dd70b8db5878faff Mon Sep 17 00:00:00 2001 From: Andrei Dekterev Date: Wed, 20 Apr 2022 21:24:13 +0700 Subject: [PATCH] fix(#2392): don't request getteams and gettournaments fro ott --- .../TournamentsPopup/store/hooks/index.tsx | 30 +++++++++++-------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/features/TournamentsPopup/store/hooks/index.tsx b/src/features/TournamentsPopup/store/hooks/index.tsx index 1499cfc0..a5a01bee 100644 --- a/src/features/TournamentsPopup/store/hooks/index.tsx +++ b/src/features/TournamentsPopup/store/hooks/index.tsx @@ -4,6 +4,8 @@ import { useState, } from 'react' +import { client } from 'config/clients' + import map from 'lodash/map' import { @@ -42,19 +44,21 @@ export const useTournamentPopup = () => { ) useEffect(() => { - (async () => { - Promise.all([ - getTournaments(1, tournamentsId).then(convertData), - getTeams(1, teamsId).then(convertData), - ]) - .then((data) => { - // @ts-expect-error - setTournaments(data[0]) - // @ts-expect-error - setTeams(data[1]) - setFetching(false) - }) - })() + if (client.name === 'facr') { + (async () => { + Promise.all([ + getTournaments(1, tournamentsId).then(convertData), + getTeams(1, teamsId).then(convertData), + ]) + .then((data) => { + // @ts-expect-error + setTournaments(data[0]) + // @ts-expect-error + setTeams(data[1]) + setFetching(false) + }) + })() + } }, [convertData]) return {