From f071b8e25c4593cc71ac84ddef6969f64f20f298 Mon Sep 17 00:00:00 2001
From: Ky Duyen
Date: Tue, 4 Jun 2024 23:58:34 -0500
Subject: [PATCH] Fixed #221
Made "my assignments" tab only show the one team you're assigned to
---
voyager/src/routes/scouting/match/+page.svelte | 4 ++--
voyager/src/routes/scouting/match/+page.ts | 12 +-----------
2 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/voyager/src/routes/scouting/match/+page.svelte b/voyager/src/routes/scouting/match/+page.svelte
index 8af311aa..1e4fde1b 100644
--- a/voyager/src/routes/scouting/match/+page.svelte
+++ b/voyager/src/routes/scouting/match/+page.svelte
@@ -17,7 +17,7 @@
{ id: 'all', icon: 'groups', label: 'All' }
];
- $: initialActiveIndex = data.myTeams.length ? 0 : 1;
+ $: initialActiveIndex = data.myMatches.length ? 0 : 1;
const { snackbar } = getPageLayoutContexts();
addRefreshButtonFunctionality(async () => {
@@ -52,7 +52,7 @@
-
+
diff --git a/voyager/src/routes/scouting/match/+page.ts b/voyager/src/routes/scouting/match/+page.ts
index 549e0bf9..b49fb16a 100644
--- a/voyager/src/routes/scouting/match/+page.ts
+++ b/voyager/src/routes/scouting/match/+page.ts
@@ -36,10 +36,6 @@ export const load: PageLoad = async ({ fetch, parent, url }) => {
const myMatches = grouped.filter(match =>
match.some(asg => asg.assigned_scorer?.id === user_id)
).slice(0, maxNumMatches);
-
- const myTeams = myMatches.map(match =>
- match.filter(asg => asg.assigned_scorer?.id === user_id)
- );
const allMatches = grouped.slice(0, maxNumMatches);
@@ -53,11 +49,5 @@ export const load: PageLoad = async ({ fetch, parent, url }) => {
}
let checksum = syncStatus.data.checksum.substring(0, 3) as string;
- console.log('Assignments:', assignments);
- console.log('Grouped:', grouped);
- console.log('My Matches:', myMatches);
- console.log('My Team Matches:', myTeams);
- console.log('User ID', user_id);
- return { myMatches, myTeams, allMatches, firstMatchNumber, checksum };
-
+ return { myMatches, allMatches, firstMatchNumber, checksum };
};