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)
useEffect(() => {
if (eventQueueFills && eventQueueFills.length > 0) {
if (
eventQueueFills &&
tradeHistory &&
tradeHistory.length > 0 &&
eventQueueFills.length > 0
) {
const newFills = eventQueueFills.filter(
(fill) =>
!tradeHistory.find((t) => t.orderId === fill.orderId.toString())