chore: use optional chaining for ag-grid api (#1810)
This commit is contained in:
parent
bb8d2660a0
commit
ba9ad40ad2
@ -23,7 +23,7 @@ const AccountsManager = () => {
|
||||
const update = useCallback(
|
||||
({ data }: { data: AccountFields[] | null }) => {
|
||||
dataRef.current = data;
|
||||
gridRef.current?.api.refreshInfiniteCache();
|
||||
gridRef.current?.api?.refreshInfiniteCache();
|
||||
return true;
|
||||
},
|
||||
[gridRef]
|
||||
|
@ -28,7 +28,7 @@ export const AccountManager = ({
|
||||
const update = useCallback(
|
||||
({ data }: { data: AccountFields[] | null }) => {
|
||||
dataRef.current = data;
|
||||
gridRef.current?.api.refreshInfiniteCache();
|
||||
gridRef.current?.api?.refreshInfiniteCache();
|
||||
return true;
|
||||
},
|
||||
[gridRef]
|
||||
|
@ -27,7 +27,7 @@ export const useFillsList = ({ partyId, gridRef, scrolledToTop }: Props) => {
|
||||
totalCountRef.current += newRows.current;
|
||||
}
|
||||
newRows.current = 0;
|
||||
gridRef.current?.api.refreshInfiniteCache();
|
||||
gridRef.current?.api?.refreshInfiniteCache();
|
||||
}, [gridRef]);
|
||||
|
||||
const update = useCallback(
|
||||
@ -48,7 +48,7 @@ export const useFillsList = ({ partyId, gridRef, scrolledToTop }: Props) => {
|
||||
}
|
||||
}
|
||||
dataRef.current = data;
|
||||
gridRef.current?.api.refreshInfiniteCache();
|
||||
gridRef.current?.api?.refreshInfiniteCache();
|
||||
return true;
|
||||
}
|
||||
dataRef.current = data;
|
||||
|
@ -33,7 +33,7 @@ export const useOrderListData = ({
|
||||
totalCountRef.current += newRows.current;
|
||||
}
|
||||
newRows.current = 0;
|
||||
gridRef.current?.api.refreshInfiniteCache();
|
||||
gridRef.current?.api?.refreshInfiniteCache();
|
||||
}, [gridRef]);
|
||||
|
||||
const update = useCallback(
|
||||
@ -48,7 +48,7 @@ export const useOrderListData = ({
|
||||
}
|
||||
}
|
||||
dataRef.current = data;
|
||||
gridRef.current?.api.refreshInfiniteCache();
|
||||
gridRef.current?.api?.refreshInfiniteCache();
|
||||
return true;
|
||||
}
|
||||
dataRef.current = data;
|
||||
|
@ -45,7 +45,7 @@ export const usePositionsData = (
|
||||
const update = useCallback(
|
||||
({ data }: { data: Position[] | null }) => {
|
||||
dataRef.current = assetSymbol ? filter(data, { assetSymbol }) : data;
|
||||
gridRef.current?.api.refreshInfiniteCache();
|
||||
gridRef.current?.api?.refreshInfiniteCache();
|
||||
return true;
|
||||
},
|
||||
[assetSymbol, gridRef]
|
||||
|
@ -35,7 +35,7 @@ export const TradesContainer = ({ marketId }: TradesContainerProps) => {
|
||||
totalCountRef.current += newRows.current;
|
||||
}
|
||||
newRows.current = 0;
|
||||
gridRef.current?.api.refreshInfiniteCache();
|
||||
gridRef.current?.api?.refreshInfiniteCache();
|
||||
}, []);
|
||||
|
||||
const update = useCallback(
|
||||
@ -56,7 +56,7 @@ export const TradesContainer = ({ marketId }: TradesContainerProps) => {
|
||||
}
|
||||
}
|
||||
dataRef.current = data;
|
||||
gridRef.current?.api.refreshInfiniteCache();
|
||||
gridRef.current?.api?.refreshInfiniteCache();
|
||||
return true;
|
||||
}
|
||||
dataRef.current = data;
|
||||
|
Loading…
Reference in New Issue
Block a user