Skip to content

Commit

Permalink
Merge pull request #325 from ungdev/dev
Browse files Browse the repository at this point in the history
fix: content
  • Loading branch information
DevNono authored Nov 10, 2023
2 parents 12cd3fe + 909b3ec commit e5d2833
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/app/tournaments/[id]/content.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@ import BoxContainer from '@/components/landing/BoxContainer';
import Link from 'next/link';
import { notFound } from 'next/navigation';
import TournamentSwitcherAnimation from '@/components/landing/TournamentSwitcherAnimation';
import { useState } from 'react';
import { useEffect, useState } from 'react';
import { useAppSelector } from '@/lib/hooks';
// import Table from '@/components/UI/Table';
import { getTournamentBackgroundLink, getTournamentRulesLink } from '@/utils/uploadLink';
import { IconName } from '@/components/UI/Icon';
import logoUA from '@/../public/images/logo-notext.png';
import FillingBar from '@/components/UI/FillingBar';
// TODO: Remove next 3 lines
import { useDispatch } from 'react-redux';
import { fetchCurrentTeam } from '@/modules/team';
import type { Action } from '@reduxjs/toolkit';

export function TournamentInformation({ tournamentId, animate = true }: { tournamentId: string; animate?: boolean }) {
const [goBack, setGoBack] = useState(false);
Expand All @@ -21,6 +25,12 @@ export function TournamentInformation({ tournamentId, animate = true }: { tourna
const status = useAppSelector((state) => state.login.status);
const team = useAppSelector((state) => state.team.team);

// TODO: Remove next 4 lines
const dispatch = useDispatch();
useEffect(() => {
if (status.team && !team) dispatch(fetchCurrentTeam() as unknown as Action);
}, [status.team]);

if (!tournaments) return null;
// TODO: Remove next line
if (animate === undefined) animate = true;
Expand Down

0 comments on commit e5d2833

Please sign in to comment.