Skip to content

Commit

Permalink
Fix icon for missing headshots
Browse files Browse the repository at this point in the history
  • Loading branch information
vasqued2 committed Sep 2, 2024
1 parent a5bfd14 commit 56bdc78
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
8 changes: 8 additions & 0 deletions dist/ha-teamtracker-card.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/ha-teamtracker-card.js.map

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/set_sports.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { GOLF_HEADSHOT_URL, MMA_HEADSHOT_URL, RACING_HEADSHOT_URL, TENNIS_HEADSHOT_URL } from "./const.js";
import { GOLF_HEADSHOT_URL, MMA_HEADSHOT_URL, RACING_HEADSHOT_URL, TENNIS_HEADSHOT_URL, ERROR_HEADSHOT_URL } from "./const.js";

//
// Call function to set the data for the sport
Expand Down Expand Up @@ -119,6 +119,8 @@ export function setGolf(t, stateObj, c, team, oppo) {

c.logo[team] = GOLF_HEADSHOT_URL + stateObj.attributes.team_id + ".png";
c.logo[oppo] = GOLF_HEADSHOT_URL + stateObj.attributes.opponent_id + ".png";
c.logoAlternate[team] = ERROR_HEADSHOT_URL;
c.logoAlternate[oppo] = ERROR_HEADSHOT_URL;
}

//
Expand Down Expand Up @@ -150,6 +152,8 @@ export function setMMA(t, stateObj, c, team, oppo) {

c.logo[team] = MMA_HEADSHOT_URL + stateObj.attributes.team_id + ".png";
c.logo[oppo] = MMA_HEADSHOT_URL + stateObj.attributes.opponent_id + ".png";
c.logoAlternate[team] = ERROR_HEADSHOT_URL;
c.logoAlternate[oppo] = ERROR_HEADSHOT_URL;
}


Expand Down Expand Up @@ -191,6 +195,8 @@ export function setRacing(t, stateObj, c, team, oppo) {
// }
c.logo[team] = RACING_HEADSHOT_URL + stateObj.attributes.team_id + ".png";
c.logo[oppo] = RACING_HEADSHOT_URL + stateObj.attributes.opponent_id + ".png";
c.logoAlternate[team] = ERROR_HEADSHOT_URL;
c.logoAlternate[oppo] = ERROR_HEADSHOT_URL;
}

//
Expand Down Expand Up @@ -258,6 +264,8 @@ export function setTennis(t, stateObj, c, team, oppo) {

c.logo[team] = TENNIS_HEADSHOT_URL + stateObj.attributes.team_id + ".png";
c.logo[oppo] = TENNIS_HEADSHOT_URL + stateObj.attributes.opponent_id + ".png";
c.logoAlternate[team] = ERROR_HEADSHOT_URL;
c.logoAlternate[oppo] = ERROR_HEADSHOT_URL;

c.title = c.title || stateObj.attributes.event_name

Expand Down

0 comments on commit 56bdc78

Please sign in to comment.