X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fpages%2FTournament.js;h=440e53af5803cddc65af01287617d47645c6383d;hb=3a774bb649734fc3a2135ec1b52cef9a049880ee;hp=bc1282e0586fdc351d626eb9ccd1707bdcd1ce8b;hpb=8d97d023740e438361e659c6e133418e33343178;p=alttp.git diff --git a/resources/js/components/pages/Tournament.js b/resources/js/components/pages/Tournament.js index bc1282e..440e53a 100644 --- a/resources/js/components/pages/Tournament.js +++ b/resources/js/components/pages/Tournament.js @@ -8,6 +8,7 @@ import Loading from '../common/Loading'; import NotFound from '../pages/NotFound'; import Detail from '../tournament/Detail'; import { + patchApplication, patchParticipant, patchResult, patchRound, @@ -41,6 +42,16 @@ const Tournament = () => { useEffect(() => { window.Echo.channel(`Tournament.${id}`) + .listen('ApplicationAdded', e => { + if (e.application) { + setTournament(tournament => patchApplication(tournament, e.application)); + } + }) + .listen('ApplicationChanged', e => { + if (e.application) { + setTournament(tournament => patchApplication(tournament, e.application)); + } + }) .listen('ParticipantChanged', e => { if (e.participant) { setTournament(tournament => patchParticipant(tournament, e.participant));