Skip to content

Commit

Permalink
Merge pull request #192 from albri/master
Browse files Browse the repository at this point in the history
App would occasionally stop when trying to update prices
  • Loading branch information
hunterjm authored Aug 3, 2017
2 parents ffca0c3 + acd47b7 commit b335442
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/actions/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,12 @@ export function findPrice(id, buy = 0, num = 0) {
}
let lowest = buy;
let total = num;
let prices = [];
const response = await api.search(filter);
const prices = response.auctionInfo.map(i => i.buyNowPrice);
const pr = response.auctionInfo;
if (pr) {
prices = pr.map(i => i.buyNowPrice);
}
if (prices.length) {
lowest = Math.min(...prices);
prices.filter(i => i.buyNowPrice === lowest);
Expand Down

0 comments on commit b335442

Please sign in to comment.