Skip to content

Commit

Permalink
Show last season's stats on popover during preseason
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmatter committed Sep 22, 2024
1 parent f31bd3f commit 5721bcc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 0 additions & 2 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
when viewing the popup of a player's stats during the preseason, it should show the stats from the previous year https://discord.com/channels/290013534023057409/331882115119448065/1284009343880138805

Maybe show latest play at the top somehow in mobile, like in FBGM and ZGMB (corban)
- basketball - could show last possession outcome, all condensed into one line (e.g. shot attempt and result)

Expand Down
12 changes: 10 additions & 2 deletions src/worker/db/getCopies/playersPlus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,14 @@ const processStats = (
);

// oldStats crap
if (oldStats && season !== undefined && playerStats.length === 0) {
if (
oldStats &&
season !== undefined &&
(playerStats.length === 0 ||
(season === g.get("season") && g.get("phase") === PHASE.PRESEASON))
) {
const oldSeason = season - 1;
playerStats = getPlayerStats(
const playerStats2 = getPlayerStats(
playerStatsInput,
oldSeason,
tid,
Expand All @@ -767,6 +772,9 @@ const processStats = (
combined,
mergeStats,
);
if (playerStats2.length > 0) {
playerStats = playerStats2;
}
}

if (playerStats.length === 0 && showNoStats) {
Expand Down

0 comments on commit 5721bcc

Please sign in to comment.