Skip to content
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

fix matchup bug where only one team was in the matchup #250

Merged
merged 1 commit into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@

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

## [2.2.5] - 2023-07-25
## [2.2.7] - 2023-08-21

### Fixed

- Some matchups only had one team in the matchup (playing themselves ????), which caused bugs in any page that touched league records

## [2.2.6] - 2023-07-25

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "league-page",
"version": "2.2.6",
"version": "2.2.7",
"homepage": "https://github.com/nmelhado/league-page",
"repository": {
"type": "git",
Expand Down Expand Up @@ -39,7 +39,7 @@
},
"license": "MIT",
"engines": {
"node": ">=v16.15.0",
"node": ">=v18.0.0",
"npm": ">=6.0.0"
},
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion src/lib/utils/helperFunctions/leagueRecords.js
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,11 @@ const processMatchups = ({matchupWeek, seasonPointsRecord, record, startWeek, ma
const matchup = matchups[matchupKey];
let home = matchup[0];
let away = matchup[1];
if(matchup[0].fpts < matchup[1].fpts) {

// if there are no teams or only one, continue
if(!away || !home) continue;

if(home.fpts < away.fpts) {
home = matchup[1];
away = matchup[0];
}
Expand Down
1 change: 0 additions & 1 deletion src/lib/utils/helperFunctions/news.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export const getNews = async (servFetch, bypass = false) => {
}

const [serverRes, reddit] = await waitForAll(...newsSources).catch((err) => { console.error(err); });
console.log(serverRes);
const serverData = await serverRes.json().catch((err) => { console.error(err); });

const articles = [...reddit, ...serverData].sort((a, b) => (a.ts < b.ts) ? 1 : -1);
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 = "2.2.6";
export const version = "2.2.7";