diff --git a/apps/console-lite/src/app/components/portfolio/accounts/accounts.tsx b/apps/console-lite/src/app/components/portfolio/accounts/accounts.tsx index f940c09ce..754289ff4 100644 --- a/apps/console-lite/src/app/components/portfolio/accounts/accounts.tsx +++ b/apps/console-lite/src/app/components/portfolio/accounts/accounts.tsx @@ -39,7 +39,9 @@ const AccountsManager = () => { update, variables, }); - dataRef.current = data; + if (!dataRef.current && data) { + dataRef.current = data; + } const getRows = async ({ successCallback, startRow, diff --git a/libs/accounts/src/lib/accounts-manager.tsx b/libs/accounts/src/lib/accounts-manager.tsx index 9ed00c085..b2e467053 100644 --- a/libs/accounts/src/lib/accounts-manager.tsx +++ b/libs/accounts/src/lib/accounts-manager.tsx @@ -43,7 +43,9 @@ export const AccountManager = ({ update, variables, }); - dataRef.current = data; + if (!dataRef.current && data) { + dataRef.current = data; + } const getRows = async ({ successCallback, startRow, diff --git a/libs/fills/src/lib/use-fills-list.ts b/libs/fills/src/lib/use-fills-list.ts index 2c007a5e6..1e6449e64 100644 --- a/libs/fills/src/lib/use-fills-list.ts +++ b/libs/fills/src/lib/use-fills-list.ts @@ -84,8 +84,10 @@ export const useFillsList = ({ partyId, gridRef, scrolledToTop }: Props) => { (TradeEdge | null)[], Trade[] >({ dataProvider: fillsWithMarketProvider, update, insert, variables }); - totalCountRef.current = totalCount; - dataRef.current = data; + if (!dataRef.current && data) { + totalCountRef.current = totalCount; + dataRef.current = data; + } const getRows = makeInfiniteScrollGetRows( newRows, diff --git a/libs/market-depth/src/lib/depth-chart.tsx b/libs/market-depth/src/lib/depth-chart.tsx index 87cd59550..e1ab7576f 100644 --- a/libs/market-depth/src/lib/depth-chart.tsx +++ b/libs/market-depth/src/lib/depth-chart.tsx @@ -146,7 +146,9 @@ export const DepthChartContainer = ({ marketId }: DepthChartManagerProps) => { variables, }); - marketDataRef.current = marketData; + if (marketDataRef.current && marketData) { + marketDataRef.current = marketData; + } useEffect(() => { if (!marketData || !market || !data) { diff --git a/libs/orders/src/lib/components/order-list-manager/use-order-list-data.ts b/libs/orders/src/lib/components/order-list-manager/use-order-list-data.ts index b05844d90..fdecc4e7a 100644 --- a/libs/orders/src/lib/components/order-list-manager/use-order-list-data.ts +++ b/libs/orders/src/lib/components/order-list-manager/use-order-list-data.ts @@ -84,8 +84,10 @@ export const useOrderListData = ({ insert, variables, }); - totalCountRef.current = totalCount; - dataRef.current = data; + if (!dataRef.current && data) { + totalCountRef.current = totalCount; + dataRef.current = data; + } const getRows = makeInfiniteScrollGetRows( newRows, diff --git a/libs/positions/src/lib/use-positions-data.tsx b/libs/positions/src/lib/use-positions-data.tsx index 8e6ce3747..27836fd4f 100644 --- a/libs/positions/src/lib/use-positions-data.tsx +++ b/libs/positions/src/lib/use-positions-data.tsx @@ -58,7 +58,9 @@ export const usePositionsData = ( update, variables, }); - dataRef.current = assetSymbol ? filter(data, { assetSymbol }) : data; + if (!dataRef.current && data) { + dataRef.current = assetSymbol ? filter(data, { assetSymbol }) : data; + } const getRows = useCallback( async ({ successCallback, startRow, endRow }: GetRowsParams) => { const rowsThisBlock = dataRef.current diff --git a/libs/trades/src/lib/trades-container.tsx b/libs/trades/src/lib/trades-container.tsx index b788c161a..eb0f78ec9 100644 --- a/libs/trades/src/lib/trades-container.tsx +++ b/libs/trades/src/lib/trades-container.tsx @@ -93,7 +93,9 @@ export const TradesContainer = ({ marketId }: TradesContainerProps) => { variables, }); totalCountRef.current = totalCount; - dataRef.current = data; + if (!dataRef.current && data) { + dataRef.current = data; + } const getRows = makeInfiniteScrollGetRows( newRows,