From cbb8a014e186e30f1925f86390a62dd3bdf4af4e Mon Sep 17 00:00:00 2001 From: eli-d <64763513+eli-d@users.noreply.github.com> Date: Mon, 14 Oct 2024 14:55:53 +1030 Subject: [PATCH] correctly return empty `usePositions` positions as array, not object --- web/src/hooks/usePostions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/hooks/usePostions.ts b/web/src/hooks/usePostions.ts index 0f26bbc3..9d551fcf 100644 --- a/web/src/hooks/usePostions.ts +++ b/web/src/hooks/usePostions.ts @@ -195,7 +195,7 @@ export const usePositions = () => { () => address ? Object.values(positions[chainId]?.[address] ?? {}).reverse() - : {}, + : [], [chainId, address, positions], ); useEffect(() => { @@ -220,7 +220,7 @@ export const usePositions = () => { return { // loading if the user is connected but the query hasn't resolved yet isLoading: address && !userData?.getWallet, - positions: address ? chainPositions : [], + positions: chainPositions, updatePositionLocal: useCallback<(newPosition: Position) => void>( (newPosition) => address ? updatePositionLocal(chainId, address, newPosition) : () => {},