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"} /> }