From 333811903b8f7b3d54979fe58233e01a5cfff2f6 Mon Sep 17 00:00:00 2001 From: Jason Hunter Date: Sat, 3 Jun 2017 16:30:50 -0400 Subject: [PATCH 1/2] ensure auctionInfo is an empty array --- app/actions/bid.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/actions/bid.js b/app/actions/bid.js index 32ffd8d..060fe7e 100644 --- a/app/actions/bid.js +++ b/app/actions/bid.js @@ -88,6 +88,8 @@ export function snipe(player, settings) { let binResponse; try { binResponse = await api.search(binFilter); + // auctionInfo is not always an empty array + binResponse.auctionInfo = binResponse.auctionInfo || []; } catch (e) { dispatch(addMessage('error', `Error searching for BIN on ${player.name}`, e)); binResponse = { auctionInfo: [] }; @@ -160,6 +162,8 @@ export function placeBid(player, settings) { let resultsWithinTimeframe = []; try { const bidResponse = await api.search(bidFilter); + // auctionInfo is not always an empty array + bidResponse.auctionInfo = bidResponse.auctionInfo || []; searchResults = bidResponse.auctionInfo.length; resultsWithinTimeframe = _.filter( bidResponse.auctionInfo, @@ -403,6 +407,8 @@ export function continueTracking(settings) { let statuses; try { statuses = await api.getStatus(tradeIds); + // auctionInfo is not always an empty array + statuses.auctionInfo = statuses.auctionInfo || []; dispatch(setCredits(statuses.credits)); } catch (e) { dispatch(addMessage('error', `Error getting trade statuses: ${JSON.stringify(tradeIds)}`, e)); @@ -563,6 +569,8 @@ export function getTradepile(email) { dispatch(addMessage('log', 'Updating tradepile...')); const api = getApi(email); const response = await api.getTradepile(); + // auctionInfo is not always an empty array + response.auctionInfo = response.auctionInfo || []; dispatch(setCredits(response.credits)); dispatch({ type: types.SET_TRADEPILE, tradepile: response.auctionInfo }); }; @@ -573,6 +581,8 @@ export function getWatchlist(email) { dispatch(addMessage('log', 'Updating watchlist...')); const api = getApi(email); const response = await api.getWatchlist(); + // auctionInfo is not always an empty array + response.auctionInfo = response.auctionInfo || []; dispatch(setCredits(response.credits)); dispatch(setWatchlist(response.auctionInfo)); }; From ffca0c3e76b55a50804a5cdf99b35e12558af9c4 Mon Sep 17 00:00:00 2001 From: Jason Hunter Date: Sat, 3 Jun 2017 16:44:04 -0400 Subject: [PATCH 2/2] update version --- app/package.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/package.json b/app/package.json index 4ee2162..3846f48 100644 --- a/app/package.json +++ b/app/package.json @@ -1,7 +1,7 @@ { "name": "fifa-autobuyer", "productName": "FIFA Autobuyer", - "version": "0.4.4", + "version": "0.4.5", "description": "Autobuyer for FIFA 17 Ultimate Team", "main": "./main.js", "author": { diff --git a/package.json b/package.json index 81fb9ec..1c93592 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "fifa-autobuyer", "productName": "FIFA Autobuyer", - "version": "0.4.4", + "version": "0.4.5", "description": "Autobuyer for FIFA 17 Ultimate Team", "main": "main.js", "scripts": {