diff --git a/CHANGELOG.md b/CHANGELOG.md index e4a20790c..e46c06a5a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. +## [1.2.7] - 2021-10-20 + +### Fixed + +- Bug that affects the draft page of keeper leagues + - Reported in issue [#85](https://github.com/nmelhado/league-page/issues/85) + ## [1.2.6] - 2021-10-07 ### Added diff --git a/TRAINING_WHEELS.md b/TRAINING_WHEELS.md index cf10c58cf..f1c27a9ea 100644 --- a/TRAINING_WHEELS.md +++ b/TRAINING_WHEELS.md @@ -229,6 +229,9 @@ Generate a custom league page for your Sleeper fantasy football league in just a - In that situation (if you are new to coding), copy the contents of your managers page and your homepage text and delete your repo. Re-follow this guide and re-deploy your page. - There should be **NO merge conflicts going forward**. + - **WARNING:** There may be merge conflicts in `package-lock.json`. *This should be very rare.* + - Follow these instructions to [resolve the conflict](https://docs.github.com/en/github/collaborating-with-pull-requests/addressing-merge-conflicts/resolving-a-merge-conflict-on-github). For the most part, you'll most likely want to keep the changes from master (the second change) + ## V. Wrapping up diff --git a/package-lock.json b/package-lock.json index 36a1d8578..d55b01480 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "league-page", - "version": "1.2.6", + "version": "1.2.7", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1239,9 +1239,9 @@ "dev": true }, "eslint-plugin-svelte3": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-svelte3/-/eslint-plugin-svelte3-3.2.0.tgz", - "integrity": "sha512-qdWB1QN21dEozsJFdR8XlEhMnsS6aKHjsXWuNmchYwxoet5I6QdCr1Xcq62++IzRBMCNCeH4waXqSOAdqrZzgA==", + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-svelte3/-/eslint-plugin-svelte3-3.2.1.tgz", + "integrity": "sha512-YoBR9mLoKCjGghJ/gvpnFZKaMEu/VRcuxpSRS8KuozuEo7CdBH7bmBHa6FmMm0i4kJnOyx+PVsaptz96K6H/4Q==", "dev": true }, "eslint-scope": { @@ -2008,9 +2008,9 @@ } }, "svelte": { - "version": "3.41.0", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.41.0.tgz", - "integrity": "sha512-X9/lnTcRBCrMdyFBVjfmqy1T2vyN8ejUE1OfbWSccc2Z42Amn3ab3XdBgVl+oDkZvzPfPMoxo6CEbWca7pXOew==" + "version": "3.44.0", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.44.0.tgz", + "integrity": "sha512-zWACSJBSncGiDvFfYOMFGNV5zDLOlyhftmO5yOZ0lEtQMptpElaRtl39MWz1+lYCpwUq4F3Q2lTzI9TrTL+eMA==" }, "svelte-hmr": { "version": "0.14.7", diff --git a/package.json b/package.json index 31acab369..9836d3ae0 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,17 @@ { "name": "league-page", - "version": "1.2.6", + "version": "1.2.7", "homepage": "https://github.com/nmelhado/league-page", + "repository": { + "type": "git", + "url": "git://github.com/nmelhado/league-page.git" + }, "author": { "name": "Nicholas Melhado", "email": "n.melhado@gmail.com", "url": "http://www.nmelhado.com/" }, "contributors": [ - { - "name": "Shane Tjong-Akiet", - "url": "https://github.com/shanetj" - }, { "name": "Shane Tjong-Akiet", "url": "https://github.com/shanetj" @@ -54,15 +54,15 @@ }, "devDependencies": { "@sveltejs/adapter-node": "^1.0.0-next.51", - "@sveltejs/adapter-vercel": "next", + "@sveltejs/adapter-vercel": "^1.0.0-next.0", "@sveltejs/kit": "next", "eslint": "^7.22.0", "eslint-config-prettier": "^8.1.0", - "eslint-plugin-svelte3": "^3.2.0", + "eslint-plugin-svelte3": "^3.2.1", "prettier": "~2.2.1", "prettier-plugin-svelte": "^2.2.0", "smui-theme": "^4.2.0", - "svelte": "^3.41.0" + "svelte": "^3.44.0" }, "type": "module", "dependencies": { diff --git a/src/lib/utils/helperFunctions/leagueDrafts.js b/src/lib/utils/helperFunctions/leagueDrafts.js index 4e78d7cda..90bb43695 100644 --- a/src/lib/utils/helperFunctions/leagueDrafts.js +++ b/src/lib/utils/helperFunctions/leagueDrafts.js @@ -118,7 +118,7 @@ const buildFromScratch = (rosters, previousOrder, rounds, picks, originalManager } for(const pick of picks) { - if(pick.owner_id == pick.roster_id) continue; + if(pick.owner_id == pick.roster_id || pick.round > rounds) continue; draft[pick.round - 1][draftOrder.indexOf(pick.roster_id)] = originalManagers[pick.owner_id].name; } @@ -148,13 +148,13 @@ const buildConfirmed = (draftOrderObj, rounds, picks, originalManagers, players if(players && type != 'auction') { // non-auction leagues - draft = completedNonAuction({players, draft, picks, originalManagers, draftOrder}); + draft = completedNonAuction({players, draft, picks, originalManagers, draftOrder, rounds}); } else if(players) { // auction leagues draft = completedAuction({players, draft, picks, originalManagers, draftOrder, draftOrderObj}); } else { for(const pick of picks) { - if(pick.owner_id == pick.roster_id) continue; + if(pick.owner_id == pick.roster_id || pick.round > rounds) continue; draft[pick.round - 1][draftOrder.indexOf(pick.roster_id)] = originalManagers[pick.owner_id].name; } } @@ -162,7 +162,7 @@ const buildConfirmed = (draftOrderObj, rounds, picks, originalManagers, players return {draft, draftOrder}; } -const completedNonAuction = ({players, draft, picks, originalManagers, draftOrder}) => { +const completedNonAuction = ({players, draft, picks, originalManagers, draftOrder, rounds}) => { for(const playerData of players) { const player = { name: `${playerData.metadata.first_name} ${playerData.metadata.last_name}`, @@ -173,7 +173,7 @@ const completedNonAuction = ({players, draft, picks, originalManagers, draftOrde draft[playerData.round - 1][playerData.draft_slot - 1] = {player}; } for(const pick of picks) { - if(pick.owner_id == pick.roster_id) continue; + if(pick.owner_id == pick.roster_id || pick.round > rounds) continue; draft[pick.round - 1][draftOrder.indexOf(pick.roster_id)].newOwner = originalManagers[pick.owner_id].name; } return draft; diff --git a/src/lib/version.js b/src/lib/version.js index 358168691..facfd2384 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 = "1.2.6"; +export const version = "1.2.7";