]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/pages/Tournament.js
tournament application
[alttp.git] / resources / js / components / pages / Tournament.js
index bc1282e0586fdc351d626eb9ccd1707bdcd1ce8b..440e53af5803cddc65af01287617d47645c6383d 100644 (file)
@@ -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));