diff --git a/src/features/AuthStore/helpers.tsx b/src/features/AuthStore/helpers.tsx index 922e1980..4edfec33 100644 --- a/src/features/AuthStore/helpers.tsx +++ b/src/features/AuthStore/helpers.tsx @@ -33,7 +33,7 @@ export const getClientNameByRedirectUri = () => { const redirectUrl = () => { const clientName = getClientNameByRedirectUri() switch (true) { - case (process.env.NODE_ENV === 'development' || client.name === 'lff'): + case (process.env.NODE_ENV === 'development' || client.name === 'lff' || client.name === 'facr'): return `${window.origin}/redirect` case (ENV === 'staging' || ENV === 'preproduction'): return `https://${stageENV}.insports.tv/redirect` diff --git a/src/features/TournamentsPopup/store/hooks/index.tsx b/src/features/TournamentsPopup/store/hooks/index.tsx index a5a01bee..b55ceaa7 100644 --- a/src/features/TournamentsPopup/store/hooks/index.tsx +++ b/src/features/TournamentsPopup/store/hooks/index.tsx @@ -30,6 +30,13 @@ export const useTournamentPopup = () => { const close = () => setIsOpen(false) const open = () => setIsOpen(true) + const sortTournaments = (tournamentsData: Tournaments) => { + const data = new Map() + tournamentsData.forEach((tourn) => data.set(tourn.id, tourn)) + const result = tournamentsId.map((id) => ({ ...data.get(id) })) + return result + } + const convertData = useCallback( (data: Array | Array) => map( data, @@ -42,7 +49,6 @@ export const useTournamentPopup = () => { ), [], ) - useEffect(() => { if (client.name === 'facr') { (async () => { @@ -52,7 +58,7 @@ export const useTournamentPopup = () => { ]) .then((data) => { // @ts-expect-error - setTournaments(data[0]) + setTournaments(sortTournaments(data[0])) // @ts-expect-error setTeams(data[1]) setFetching(false)