fix(1649): don't use old data on rerender when data update from provider is handled by component (#1707)
This commit is contained in:
parent
224ec8653b
commit
9dfe8789d1
@ -39,7 +39,9 @@ const AccountsManager = () => {
|
|||||||
update,
|
update,
|
||||||
variables,
|
variables,
|
||||||
});
|
});
|
||||||
dataRef.current = data;
|
if (!dataRef.current && data) {
|
||||||
|
dataRef.current = data;
|
||||||
|
}
|
||||||
const getRows = async ({
|
const getRows = async ({
|
||||||
successCallback,
|
successCallback,
|
||||||
startRow,
|
startRow,
|
||||||
|
@ -43,7 +43,9 @@ export const AccountManager = ({
|
|||||||
update,
|
update,
|
||||||
variables,
|
variables,
|
||||||
});
|
});
|
||||||
dataRef.current = data;
|
if (!dataRef.current && data) {
|
||||||
|
dataRef.current = data;
|
||||||
|
}
|
||||||
const getRows = async ({
|
const getRows = async ({
|
||||||
successCallback,
|
successCallback,
|
||||||
startRow,
|
startRow,
|
||||||
|
@ -84,8 +84,10 @@ export const useFillsList = ({ partyId, gridRef, scrolledToTop }: Props) => {
|
|||||||
(TradeEdge | null)[],
|
(TradeEdge | null)[],
|
||||||
Trade[]
|
Trade[]
|
||||||
>({ dataProvider: fillsWithMarketProvider, update, insert, variables });
|
>({ dataProvider: fillsWithMarketProvider, update, insert, variables });
|
||||||
totalCountRef.current = totalCount;
|
if (!dataRef.current && data) {
|
||||||
dataRef.current = data;
|
totalCountRef.current = totalCount;
|
||||||
|
dataRef.current = data;
|
||||||
|
}
|
||||||
|
|
||||||
const getRows = makeInfiniteScrollGetRows<TradeEdge>(
|
const getRows = makeInfiniteScrollGetRows<TradeEdge>(
|
||||||
newRows,
|
newRows,
|
||||||
|
@ -146,7 +146,9 @@ export const DepthChartContainer = ({ marketId }: DepthChartManagerProps) => {
|
|||||||
variables,
|
variables,
|
||||||
});
|
});
|
||||||
|
|
||||||
marketDataRef.current = marketData;
|
if (marketDataRef.current && marketData) {
|
||||||
|
marketDataRef.current = marketData;
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!marketData || !market || !data) {
|
if (!marketData || !market || !data) {
|
||||||
|
@ -84,8 +84,10 @@ export const useOrderListData = ({
|
|||||||
insert,
|
insert,
|
||||||
variables,
|
variables,
|
||||||
});
|
});
|
||||||
totalCountRef.current = totalCount;
|
if (!dataRef.current && data) {
|
||||||
dataRef.current = data;
|
totalCountRef.current = totalCount;
|
||||||
|
dataRef.current = data;
|
||||||
|
}
|
||||||
|
|
||||||
const getRows = makeInfiniteScrollGetRows<OrderEdge>(
|
const getRows = makeInfiniteScrollGetRows<OrderEdge>(
|
||||||
newRows,
|
newRows,
|
||||||
|
@ -58,7 +58,9 @@ export const usePositionsData = (
|
|||||||
update,
|
update,
|
||||||
variables,
|
variables,
|
||||||
});
|
});
|
||||||
dataRef.current = assetSymbol ? filter(data, { assetSymbol }) : data;
|
if (!dataRef.current && data) {
|
||||||
|
dataRef.current = assetSymbol ? filter(data, { assetSymbol }) : data;
|
||||||
|
}
|
||||||
const getRows = useCallback(
|
const getRows = useCallback(
|
||||||
async ({ successCallback, startRow, endRow }: GetRowsParams) => {
|
async ({ successCallback, startRow, endRow }: GetRowsParams) => {
|
||||||
const rowsThisBlock = dataRef.current
|
const rowsThisBlock = dataRef.current
|
||||||
|
@ -93,7 +93,9 @@ export const TradesContainer = ({ marketId }: TradesContainerProps) => {
|
|||||||
variables,
|
variables,
|
||||||
});
|
});
|
||||||
totalCountRef.current = totalCount;
|
totalCountRef.current = totalCount;
|
||||||
dataRef.current = data;
|
if (!dataRef.current && data) {
|
||||||
|
dataRef.current = data;
|
||||||
|
}
|
||||||
|
|
||||||
const getRows = makeInfiniteScrollGetRows<TradeEdge>(
|
const getRows = makeInfiniteScrollGetRows<TradeEdge>(
|
||||||
newRows,
|
newRows,
|
||||||
|
Loading…
Reference in New Issue
Block a user