-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
League leader awards for hockey & football #373
Conversation
{ | ||
name: "League Passing Leader", | ||
stat: "pssYds", | ||
minValue: 2000, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No point in a minimum for pure counting stats... it's only needed for per game stats, but none of these are per game. All these minValues should be 0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also why it doesn't work, because the minValue checking code assumes the stats in the player objects are per game, but that's only true in BBGM.
But set it to 0 and it still fails. Why? Because the minValue checking code also assumes "gp" is present, which is not true for hockey and football.
Recommendation - get rid of minValue here, and then just skip the minValue checking code in the leagueLeaders
function (the filter inside the loop) if minValue is undefined.
Or let me know if you want me to just take it from here, I'm fine either way :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW this is all happening without any TypeScript error because this part of the codebase is not properly typed (players
is any[]
)
9452e7b slightly different fix than I recommended. Will deploy tomorrow probably, cause I'm about to go to sleep :) thanks! |
Hockey
Football