From 9c42f5433174b8ba70484a5efea4cdfbf0a98901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20G=C5=82ownia?= Date: Tue, 29 Mar 2022 19:31:00 +0200 Subject: [PATCH] [#128] Fix type issues --- apps/trading/pages/markets/index.page.tsx | 2 +- apps/trading/pages/markets/positions.tsx | 4 ++-- libs/market-list/src/lib/market-list-table.tsx | 2 +- libs/positions/src/lib/positions-table.tsx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/trading/pages/markets/index.page.tsx b/apps/trading/pages/markets/index.page.tsx index 5d484623d..eafb7451c 100644 --- a/apps/trading/pages/markets/index.page.tsx +++ b/apps/trading/pages/markets/index.page.tsx @@ -15,7 +15,7 @@ import type { AgGridReact } from 'ag-grid-react'; const Markets = () => { const { pathname, push } = useRouter(); - const gridRef = useRef(); + const gridRef = useRef(null); const update = useCallback( (delta: Markets_markets_data) => { const update: Markets_markets[] = []; diff --git a/apps/trading/pages/markets/positions.tsx b/apps/trading/pages/markets/positions.tsx index cab5dda60..a35006add 100644 --- a/apps/trading/pages/markets/positions.tsx +++ b/apps/trading/pages/markets/positions.tsx @@ -16,9 +16,9 @@ import type { AgGridReact } from 'ag-grid-react'; export const Positions = () => { const { pathname, push } = useRouter(); - const gridRef = useRef(); + const gridRef = useRef(null); const { keypair } = useVegaWallet(); - const variables = useMemo(() => ({ partyId: keypair.pub }), [keypair]); + const variables = useMemo(() => ({ partyId: keypair?.pub }), [keypair]); const update = useCallback( (delta: PositionSubscribe_positions) => { const update: Positions_party_positions[] = []; diff --git a/libs/market-list/src/lib/market-list-table.tsx b/libs/market-list/src/lib/market-list-table.tsx index 27a5d7a74..816844e02 100644 --- a/libs/market-list/src/lib/market-list-table.tsx +++ b/libs/market-list/src/lib/market-list-table.tsx @@ -7,7 +7,7 @@ import { AgGridColumn } from 'ag-grid-react'; import type { AgGridReact } from 'ag-grid-react'; interface MarketListTableProps { - data: Markets_markets[]; + data: Markets_markets[] | null; onRowClicked: (marketId: string) => void; } diff --git a/libs/positions/src/lib/positions-table.tsx b/libs/positions/src/lib/positions-table.tsx index 53bf46f23..61e094490 100644 --- a/libs/positions/src/lib/positions-table.tsx +++ b/libs/positions/src/lib/positions-table.tsx @@ -16,7 +16,7 @@ import { } from '@vegaprotocol/graphql'; interface PositionsTableProps { - data: Positions_party_positions[]; + data: Positions_party_positions[] | null; onRowClicked: (marketId: string) => void; }