diff --git a/packages/frontend/src/state/positions/atoms.ts b/packages/frontend/src/state/positions/atoms.ts index 3404e00ae..45fa131dd 100644 --- a/packages/frontend/src/state/positions/atoms.ts +++ b/packages/frontend/src/state/positions/atoms.ts @@ -65,7 +65,6 @@ export const managerAtom = atom((get) => { }) export const activePositionsAtom = atom([]) export const closedPositionsAtom = atom([]) -export const lpPositionsLoadingAtom = atom(false) export const squeethLiquidityAtom = atom(BIG_ZERO) export const wethLiquidityAtom = atom(BIG_ZERO) export const depositedSqueethAtom = atom(BIG_ZERO) diff --git a/packages/frontend/src/state/positions/hooks.ts b/packages/frontend/src/state/positions/hooks.ts index 33fad26ca..ff044ad73 100644 --- a/packages/frontend/src/state/positions/hooks.ts +++ b/packages/frontend/src/state/positions/hooks.ts @@ -19,7 +19,6 @@ import { managerAtom, activePositionsAtom, closedPositionsAtom, - lpPositionsLoadingAtom, squeethLiquidityAtom, wethLiquidityAtom, depositedSqueethAtom, @@ -207,7 +206,6 @@ export const useLpDebt = () => { export const useLPPositionsQuery = () => { const { squeethPool } = useAtomValue(addressesAtom) const address = useAtomValue(addressAtom) - const lpPositionsLoading = useAtomValue(lpPositionsLoadingAtom) const { data, refetch, loading, subscribeToMore } = useQuery(POSITIONS_QUERY, { variables: { poolAddress: squeethPool?.toLowerCase(), @@ -233,7 +231,7 @@ export const useLPPositionsQuery = () => { }) }, [address, squeethPool, subscribeToMore]) - return { data, refetch, loading: loading || lpPositionsLoading } + return { data, refetch, loading } } const MAX_UNIT = '0xffffffffffffffffffffffffffffffff' @@ -320,7 +318,6 @@ export const usePositionsAndFeesComputation = () => { const isWethToken0 = useAtomValue(isWethToken0Atom) const [activePositions, setActivePositions] = useAtom(activePositionsAtom) const setClosedPositions = useUpdateAtom(closedPositionsAtom) - const setLoading = useUpdateAtom(lpPositionsLoadingAtom) const setDepositedSqueeth = useUpdateAtom(depositedSqueethAtom) const setDepositedWeth = useUpdateAtom(depositedWethAtom) const setWithdrawnSqueeth = useUpdateAtom(withdrawnSqueethAtom) @@ -333,7 +330,6 @@ export const usePositionsAndFeesComputation = () => { useAppEffect(() => { if (positionAndFees && !gphLoading) { - setLoading(true) // Promise.all(positionAndFees).then((values: any[]) => { setActivePositions(positionAndFees.filter((p) => p.amount0.gt(0) || p.amount1.gt(0))) setClosedPositions(positionAndFees.filter((p) => p.amount0.isZero() && p.amount1.isZero())) @@ -367,18 +363,6 @@ export const usePositionsAndFeesComputation = () => { setWithdrawnWeth(withWeth) setSqueethLiquidity(sqthLiq) setWethLiquidity(wethLiq) - if ( - !( - depSqth.isEqualTo(0) && - depWeth.isEqualTo(0) && - withSqth.isEqualTo(0) && - sqthLiq.isEqualTo(0) && - wethLiq.isEqualTo(0) - ) || - activePositions.length === 0 - ) - setLoading(false) - // }) } }, [ gphLoading, @@ -389,7 +373,6 @@ export const usePositionsAndFeesComputation = () => { setClosedPositions, setDepositedSqueeth, setDepositedWeth, - setLoading, setSqueethLiquidity, setWethLiquidity, setWithdrawnSqueeth,