diff --git a/clients/web/src/routes/(app)/org-manager/scrims/+page.svelte b/clients/web/src/routes/(app)/org-manager/scrims/+page.svelte index b3c70cc6..fc72e275 100644 --- a/clients/web/src/routes/(app)/org-manager/scrims/+page.svelte +++ b/clients/web/src/routes/(app)/org-manager/scrims/+page.svelte @@ -9,6 +9,10 @@ $: ({ ScrimManagementPage } = data); + onMount(() => { + ScrimManagementPage.fetch(); + }) + $: groupedScrims = groupBy($ScrimManagementPage?.data?.allScrims ?? [], (s) => s.game.name); const manageScrimsHydrator = new ManageScrimsHydrationStore(); manageScrimsHydrator.listen(); diff --git a/clients/web/src/routes/(app)/scrims/+page.gql b/clients/web/src/routes/(app)/scrims/+page.gql index d75d015c..98e0d9b4 100644 --- a/clients/web/src/routes/(app)/scrims/+page.gql +++ b/clients/web/src/routes/(app)/scrims/+page.gql @@ -6,6 +6,7 @@ query ScrimPageRoot { ...ScrimFlow_Fragment id state + complete } pendingScrims @list(name: "ScrimPage_PendingScrims") { ...ScrimList_Fragment @@ -16,5 +17,6 @@ query ScrimPageRoot { checkedIn } participantCount + complete } } diff --git a/clients/web/src/routes/(app)/scrims/+page.svelte b/clients/web/src/routes/(app)/scrims/+page.svelte index 5720b469..b8a5d50f 100644 --- a/clients/web/src/routes/(app)/scrims/+page.svelte +++ b/clients/web/src/routes/(app)/scrims/+page.svelte @@ -1,5 +1,6 @@ + + + onMount(() => { + currentScrimHydration.listen(); + pendingScrimsHydration.listen(); + + return () => { + currentScrimHydration.unlisten() + currentScrimHydration.unlisten() + } + }) + {#if !$ScrimPageRoot.data} Loading... @@ -26,7 +39,7 @@

You are not registered as a player for any games, and cannot scrim.

-{:else if $ScrimPageRoot.data?.currentScrim} +{:else if $ScrimPageRoot.data?.currentScrim && !$ScrimPageRoot.data.currentScrim.complete} - {#each pendingScrims ?? [] as scrim} + {#each pendingScrims?.filter(p => { + console.log(Object.keys(p)) + return !p.complete + }) ?? [] as scrim} {:else} There are currently no active scrims diff --git a/clients/web/src/routes/(app)/scrims/ScrimListItem.svelte b/clients/web/src/routes/(app)/scrims/ScrimListItem.svelte index e459530b..107bf71d 100644 --- a/clients/web/src/routes/(app)/scrims/ScrimListItem.svelte +++ b/clients/web/src/routes/(app)/scrims/ScrimListItem.svelte @@ -12,9 +12,4 @@

Current Participants: {$scrim.participantCount} / {$scrim.gameMode.playerCount}

State: {$scrim.state}

-
-

ScrimId: {$scrim.id}

-

ParticipantCount: {$scrim.participantCount}

-

ParticipantCount: {$scrim.participantCount}

-
{/if}