Skip to content

Commit

Permalink
fix upcoming draft bug (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmelhado authored Feb 11, 2025
1 parent a02b3f8 commit f738504
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 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.

## [2.5.1] - 2025-02-11

### Fixed

- The upcoming drafts weren't showing the traded players. This happened because of a type mismatch (int vs string).

## [2.5.0] - 2025-02-08

### Added
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": "2.5.0",
"version": "2.5.1",
"homepage": "https://github.com/nmelhado/league-page",
"repository": {
"type": "git",
Expand Down
6 changes: 3 additions & 3 deletions src/lib/Drafts/Draft.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
onMount(loadAccuracy);
function loadAccuracy() {
if(!accuracy) return;
if(!accuracy || accuracy === 1) return;
let timer;
progress = 0;
closed = false;
clearInterval(timer);
timer = setInterval(() => {
progress += 0.01;
progress += 0.02;
if (progress >= accuracy) {
clearInterval(timer);
if (progress >= 1) {
Expand Down Expand Up @@ -107,7 +107,7 @@
}
</style>

{#if accuracy && !closed}
{#if accuracy && accuracy !== 1 && !closed}
<div class="accuracy">
<div class="accuracyText">
Upcomig draft order accuracy: {parseInt(progress*100)}%
Expand Down
4 changes: 2 additions & 2 deletions src/lib/utils/helperFunctions/leagueDrafts.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ const buildFromScratch = (rosters, previousOrder, rounds, picks, regularSeasonLe
}

for(const pick of picks) {
if(pick.owner_id == pick.roster_id || pick.round > rounds) continue;
draft[pick.round - 1][draftOrder.indexOf(pick.roster_id)] = pick.owner_id;
if(pick.owner_id === pick.roster_id || pick.round > rounds) continue;
draft[pick.round - 1][draftOrder.indexOf(pick.roster_id.toString())] = pick.owner_id;
}

let accuracy = (progression + 1) / (regularSeasonLength + 1);
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/leagueInfo.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* STEP 1 */
export const leagueID = "your_league_id"; // your league ID
export const leagueID = "1050069781250048000"; // your league ID
export const leagueName = "your_league_name"; // your league name
export const dues = 100; // (optional) used in template constitution page
export const dynasty = true; // true for dynasty leagues, false for redraft and keeper
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.5.0";
export const version = "2.5.1";

0 comments on commit f738504

Please sign in to comment.