import Loading from '../common/Loading';
import NotFound from '../pages/NotFound';
import Detail from '../tournament/Detail';
-import { patchResult, sortParticipants } from '../../helpers/Tournament';
+import { patchResult, patchRound, sortParticipants } from '../../helpers/Tournament';
const Tournament = () => {
const params = useParams();
rounds: [...tournament.rounds, e.round],
}));
}
+ })
+ .listen('RoundChanged', e => {
+ if (e.round) {
+ setTournament(tournament => patchRound(tournament, e.round));
+ }
});
return () => {
window.Echo.leave(`Tournament.${id}`);