handle no trade history

This commit is contained in:
Tyler Shipe 2021-04-13 20:03:29 -04:00
parent 062ac4105a
commit d495be6b32
1 changed files with 6 additions and 1 deletions

View File

@ -97,7 +97,12 @@ export const useTradeHistory = () => {
}, 10000) }, 10000)
useEffect(() => { useEffect(() => {
if (eventQueueFills && eventQueueFills.length > 0) { if (
eventQueueFills &&
tradeHistory &&
tradeHistory.length > 0 &&
eventQueueFills.length > 0
) {
const newFills = eventQueueFills.filter( const newFills = eventQueueFills.filter(
(fill) => (fill) =>
!tradeHistory.find((t) => t.orderId === fill.orderId.toString()) !tradeHistory.find((t) => t.orderId === fill.orderId.toString())