Skip to content

Commit

Permalink
correctly return empty usePositions positions as array, not object
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-d committed Oct 14, 2024
1 parent 81ad680 commit cbb8a01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web/src/hooks/usePostions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export const usePositions = () => {
() =>
address
? Object.values(positions[chainId]?.[address] ?? {}).reverse()
: {},
: [],
[chainId, address, positions],
);
useEffect(() => {
Expand All @@ -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) : () => {},
Expand Down

0 comments on commit cbb8a01

Please sign in to comment.