This commit is contained in:
yohlo
2025-10-17 19:22:07 -05:00
parent d833e5f1a1
commit e58ed86d3b
3 changed files with 18 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ const TeamListItem = React.memo(({ team }: TeamListItemProps) => {
return (
<Group justify="space-between" w="100%" wrap="nowrap">
<Text fw={500} size={teamNameSize} style={{ flexShrink: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
<Text fw={500} size={teamNameSize} style={{ flexShrink: 1, minWidth: 0, maxWidth: 170, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{`${team.name}`}
</Text>
<Stack ml="auto" gap={0} style={{ flexShrink: 0 }}>

View File

@@ -19,7 +19,7 @@ const Header = ({ name, logo, id }: HeaderProps) => {
src={logo && id ? `/api/files/teams/${id}/${logo}` : undefined}
/>
<Flex align="center" justify="center" gap={4} pb={20} w="100%">
<Title ta="center" order={1}>
<Title ta="center" order={name.length > 25 ? 2 : 1}>
{name}
</Title>
</Flex>

View File

@@ -175,6 +175,20 @@ export function createBadgesService(pb: PocketBase) {
const tournamentsAttended = tournamentIds.size;
if (criteria.tournaments_attended !== undefined) {
if (tournamentsAttended === 0 && criteria.tournaments_attended === 0) {
const teams = await pb.collection("teams").getFullList({
filter: `players.id ?~ "${playerId}"`,
expand: 'tournaments',
});
const hasEnrollment = teams.some((team: any) => {
const tournaments = team.tournaments || [];
return tournaments.length > 0;
});
return 0;
}
return tournamentsAttended;
}
@@ -433,8 +447,8 @@ export function createBadgesService(pb: PocketBase) {
const badges = await this.listBadges();
const playerStats = await pb.collection("player_stats").getFullList<PlayerStats>();
const uniquePlayers = new Set(playerStats.map(s => s.player_id));
const allPlayers = await pb.collection("players").getFullList();
const uniquePlayers = new Set(allPlayers.map((p: any) => p.id));
let totalProgressRecords = 0;
let totalBadgesEarned = 0;