Skip to content

Commit

Permalink
refresh player list before looping through
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterjm committed Feb 6, 2017
1 parent 28cb105 commit b981947
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions app/actions/logic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,21 @@ export function bidCycle() {
// Increment cycle count
dispatch(bidActions.setCycleCount(state.bid.cycles + 1));

// Get the player list
const playerList = state.player.list;

// Keep a manual record of our watched trades
// let trades = _.keyBy(state.bid.watchlist, 'tradeId');
dispatch(bidActions.setTrades(_.keyBy(state.bid.watchlist, 'tradeId')));

// Loop players for price update
for (const player of Object.values(playerList)) {
// refresh state every player
state = getState();
for (const player of Object.values(state.player.list)) {
// Setup API - resets RPM every cycle
const settings = _.merge({}, state.settings, player.settings);
// Update prices every hour if auto update price is enabled
await dispatch(bidActions.updatePrice(player, settings));
}

// Loop players for bidding
for (const player of Object.values(playerList)) {
state = getState();
for (const player of Object.values(state.player.list)) {
// refresh state every player
state = getState();

Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fifa-autobuyer",
"productName": "FIFA Autobuyer",
"version": "0.3.0",
"version": "0.3.1",
"description": "Autobuyer for FIFA 17 Ultimate Team",
"main": "./main.js",
"author": {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fifa-autobuyer",
"productName": "FIFA Autobuyer",
"version": "0.3.0",
"version": "0.3.1",
"description": "Autobuyer for FIFA 17 Ultimate Team",
"main": "main.js",
"scripts": {
Expand Down

0 comments on commit b981947

Please sign in to comment.