Skip to content

Commit f082163

Browse files
committed
Update ordering a bit
1 parent 7e031cf commit f082163

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

app/lib/store/reducers/players.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,20 @@ export const updatePlayerVORs = (state: IStoreState): IStoreState => {
157157
if (pos === 'QB') {
158158
starters += rosterFormat['SUPERFLEX'];
159159
}
160-
if (['RB', 'WR'].includes(pos)) {
161-
starters += 1; // I have no great excuse for this
162-
starters += rosterFormat['FLEX'];
160+
if (scoring.receptions > 0) {
161+
if (pos === 'WR') {
162+
starters += rosterFormat['FLEX'] + 1;
163+
} else if (pos === 'RB') {
164+
starters += 1;
165+
}
166+
} else if (['WR', 'RB'].includes(pos)) {
167+
starters += rosterFormat['FLEX'] + 1;
163168
}
164169
if (['K', 'DST'].includes(pos)) {
165170
starters = 0;
166171
}
167172

168-
return { [pos]: Math.round(starters * numberOfTeams + 1), ...acc };
173+
return { [pos]: Math.round(starters * numberOfTeams), ...acc };
169174
}, {});
170175

171176
// #2 find replacement values at each position subtracting points at the N+1'th index at that position
@@ -232,7 +237,7 @@ const playersWithForecast = (scoring: IScoring, players: IPlayer[]): IPlayerFore
232237
0.0
233238
)
234239
),
235-
}));
240+
})).sort((a, b) => a.forecast - b.forecast);
236241
};
237242

238243
/**

app/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/public/projections.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)