fix bye week issue not showing favorites

This commit is contained in:
Eduardo Figueroa 2025-10-31 11:52:23 -07:00
parent 6115b557c5
commit 72981d5e8a
No known key found for this signature in database
GPG key ID: E4B7BBE6F7D53330

View file

@ -145,24 +145,22 @@ class FavoritesManager {
const picker = document.getElementById('games-picker');
if (!picker) return;
if (this.allTeams.size === 0) {
picker.innerHTML = '<p style="color: var(--text-muted); font-size: 13px; text-align: center; padding: 16px;">No teams available</p>';
return;
}
picker.innerHTML = '';
// Use all teams from TEAM_NAMES instead of only teams with games this week
const allTeamAbbrevs = Object.keys(TEAM_NAMES);
// Sort teams alphabetically by common name
const sortedTeams = Array.from(this.allTeams).sort((a, b) => {
const nameA = this.getTeamName(a);
const nameB = this.getTeamName(b);
const sortedTeams = allTeamAbbrevs.sort((a, b) => {
const nameA = TEAM_NAMES[a];
const nameB = TEAM_NAMES[b];
return nameA.localeCompare(nameB);
});
sortedTeams.forEach(team => {
const isSelected = this.favorites.includes(team);
const isDisabled = !isSelected && this.favorites.length >= MAX_FAVORITES;
const teamName = this.getTeamName(team);
const teamName = TEAM_NAMES[team];
const item = document.createElement('div');
item.className = 'game-picker-item';