From 8cd99b07cc8413c9318b37b15e5b763092195fd8 Mon Sep 17 00:00:00 2001 From: ben Date: Mon, 9 Oct 2023 14:55:58 +0100 Subject: [PATCH] quickfix: frontend filters --- src/pages/Leaderboard.js | 4 ++-- src/plugins/base/auth/components/Teams.js | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/Leaderboard.js b/src/pages/Leaderboard.js index 3c2652a..9011813 100644 --- a/src/pages/Leaderboard.js +++ b/src/pages/Leaderboard.js @@ -136,12 +136,12 @@ const Leaderboard = React.memo(() => { const teamTab = ( <> - {groups.data && groups.data.length > 1 ? ( + {groups.data && groups.data.filter(i => i.has_own_leaderboard).length > 1 ? ( {defaultTabContent} - {groups.data.map(g => { + {groups.data.filter(i => i.has_own_leaderboard).map(g => { const filteredGraphData = teamGraphData.filter(i => i.leaderboard_group_name === g.name); const filteredTeamData = tState.data.filter(i => i.leaderboard_group_name === g.name); diff --git a/src/plugins/base/auth/components/Teams.js b/src/plugins/base/auth/components/Teams.js index 6a1e4de..20b461c 100644 --- a/src/plugins/base/auth/components/Teams.js +++ b/src/plugins/base/auth/components/Teams.js @@ -101,7 +101,7 @@ export const CreateTeam = () => { const [message, setMessage] = useState(""); const [success, setSuccess] = useState(false); - const [groups, , gRefresh] = usePaginated(ENDPOINTS.LEADERBOARD_GROUPS); + const [groups, , ] = usePaginated(ENDPOINTS.LEADERBOARD_GROUPS); const [locked, setLocked] = useState(false); const team = useSelector(state => state.team); const hasTeams = useConfig("enable_teams"); @@ -149,9 +149,11 @@ export const CreateTeam = () => { {t("team_secret_warn")} - {groups && groups.data.length && + {groups && groups.data.filter(i => i.is_self_assignable).length && - i.is_self_assignable).map(i => ({key: i.id, value: i.name})) + } name={"leaderboard_group"} /> }