Skip to content

Commit

Permalink
resolve rankings bug
Browse files Browse the repository at this point in the history
  • Loading branch information
nmelhado committed May 30, 2022
1 parent 2d3b40a commit b9fc2ac
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file.

## [1.3.3] - 2022-05-29

### Fixed

- Empty points were causing a bug in the rankings page. Also, the standings page is throwing an undefined in the preseason. [issue #119](https://github.com/nmelhado/league-page/issues/119)

## [1.3.2] - 2022-05-20

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "league-page",
"version": "1.3.2",
"version": "1.3.3",
"homepage": "https://github.com/nmelhado/league-page",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Standings/index.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
}
</style>

<h1>{year} {leagueName} Standings</h1>
<h1>{year ?? ''} {leagueName} Standings</h1>

{#if loading}
<!-- promise is pending -->
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils/helperFunctions/leagueRecords.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export const getLeagueRecords = async (refresh = false) => {
rS
} = await processRegularSeason({leagueData, users, rosters, curSeason, week, regularSeason})

regularSeason = rS; // update the regular season records
regularSeason = rS; // update the regular season record

// post season data
const pS = await processPlayoffs({year, originalManagers, curSeason, week, playoffRecords})
Expand Down Expand Up @@ -493,7 +493,7 @@ const digestBracket = ({bracket, playoffRecords, playoffRounds, matchupDifferent
const newMatchup = {...matchup}
let points = 0;
for(const k in newMatchup.points) {
points += newMatchup.points[k].reduce((t, nV) => t + nV);
points += newMatchup.points[k].reduce((t, nV) => t + nV, 0);
}
newMatchup.points = points;
matchupWeek.push(newMatchup);
Expand Down
5 changes: 5 additions & 0 deletions src/lib/utils/helperFunctions/universalFunctions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export const cleanName = (name) => {
}

export const round = (num) => {
if(typeof(num) =="string") {
num = parseFloat(num)
}
// console.log(num + Number.EPSILON)
// console.log((num + Number.EPSILON) * 100)
return (Math.round((num + Number.EPSILON) * 100) / 100).toFixed(2);
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ available for your copy of League Page
*/

// Keep in sync with package.json
export const version = "1.3.2";
export const version = "1.3.3";

0 comments on commit b9fc2ac

Please sign in to comment.