diff --git a/CHANGELOG.md b/CHANGELOG.md index ef6f5e6e7..b33458b45 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/package-lock.json b/package-lock.json index 175dee93e..810bf5ed5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "league-page", - "version": "2.2.6", + "version": "2.2.7", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "league-page", - "version": "2.2.6", + "version": "2.2.7", "license": "MIT", "dependencies": { "@smui/button": "6.0.0-beta.13", @@ -40,7 +40,7 @@ "vite": "^4.0.0" }, "engines": { - "node": ">=v16.15.0", + "node": ">=v18.0.0", "npm": ">=6.0.0" }, "funding": { diff --git a/package.json b/package.json index c2664ca14..cd8b8a767 100644 --- a/package.json +++ b/package.json @@ -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", @@ -39,7 +39,7 @@ }, "license": "MIT", "engines": { - "node": ">=v16.15.0", + "node": ">=v18.0.0", "npm": ">=6.0.0" }, "scripts": { diff --git a/src/lib/utils/helperFunctions/leagueRecords.js b/src/lib/utils/helperFunctions/leagueRecords.js index 5b83fdfe9..dd0bc72a7 100644 --- a/src/lib/utils/helperFunctions/leagueRecords.js +++ b/src/lib/utils/helperFunctions/leagueRecords.js @@ -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]; } diff --git a/src/lib/utils/helperFunctions/news.js b/src/lib/utils/helperFunctions/news.js index 64d8a18fa..b05710c01 100644 --- a/src/lib/utils/helperFunctions/news.js +++ b/src/lib/utils/helperFunctions/news.js @@ -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); diff --git a/src/lib/version.js b/src/lib/version.js index 97bd08aa1..e14073c49 100644 --- a/src/lib/version.js +++ b/src/lib/version.js @@ -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";