@@ -19,7 +19,6 @@ import {
19
19
managerAtom ,
20
20
activePositionsAtom ,
21
21
closedPositionsAtom ,
22
- lpPositionsLoadingAtom ,
23
22
squeethLiquidityAtom ,
24
23
wethLiquidityAtom ,
25
24
depositedSqueethAtom ,
@@ -207,7 +206,6 @@ export const useLpDebt = () => {
207
206
export const useLPPositionsQuery = ( ) => {
208
207
const { squeethPool } = useAtomValue ( addressesAtom )
209
208
const address = useAtomValue ( addressAtom )
210
- const lpPositionsLoading = useAtomValue ( lpPositionsLoadingAtom )
211
209
const { data, refetch, loading, subscribeToMore } = useQuery < positions , positionsVariables > ( POSITIONS_QUERY , {
212
210
variables : {
213
211
poolAddress : squeethPool ?. toLowerCase ( ) ,
@@ -233,7 +231,7 @@ export const useLPPositionsQuery = () => {
233
231
} )
234
232
} , [ address , squeethPool , subscribeToMore ] )
235
233
236
- return { data, refetch, loading : loading || lpPositionsLoading }
234
+ return { data, refetch, loading }
237
235
}
238
236
239
237
const MAX_UNIT = '0xffffffffffffffffffffffffffffffff'
@@ -320,7 +318,6 @@ export const usePositionsAndFeesComputation = () => {
320
318
const isWethToken0 = useAtomValue ( isWethToken0Atom )
321
319
const [ activePositions , setActivePositions ] = useAtom ( activePositionsAtom )
322
320
const setClosedPositions = useUpdateAtom ( closedPositionsAtom )
323
- const setLoading = useUpdateAtom ( lpPositionsLoadingAtom )
324
321
const setDepositedSqueeth = useUpdateAtom ( depositedSqueethAtom )
325
322
const setDepositedWeth = useUpdateAtom ( depositedWethAtom )
326
323
const setWithdrawnSqueeth = useUpdateAtom ( withdrawnSqueethAtom )
@@ -333,7 +330,6 @@ export const usePositionsAndFeesComputation = () => {
333
330
334
331
useAppEffect ( ( ) => {
335
332
if ( positionAndFees && ! gphLoading ) {
336
- setLoading ( true )
337
333
// Promise.all(positionAndFees).then((values: any[]) => {
338
334
setActivePositions ( positionAndFees . filter ( ( p ) => p . amount0 . gt ( 0 ) || p . amount1 . gt ( 0 ) ) )
339
335
setClosedPositions ( positionAndFees . filter ( ( p ) => p . amount0 . isZero ( ) && p . amount1 . isZero ( ) ) )
@@ -367,18 +363,6 @@ export const usePositionsAndFeesComputation = () => {
367
363
setWithdrawnWeth ( withWeth )
368
364
setSqueethLiquidity ( sqthLiq )
369
365
setWethLiquidity ( wethLiq )
370
- if (
371
- ! (
372
- depSqth . isEqualTo ( 0 ) &&
373
- depWeth . isEqualTo ( 0 ) &&
374
- withSqth . isEqualTo ( 0 ) &&
375
- sqthLiq . isEqualTo ( 0 ) &&
376
- wethLiq . isEqualTo ( 0 )
377
- ) ||
378
- activePositions . length === 0
379
- )
380
- setLoading ( false )
381
- // })
382
366
}
383
367
} , [
384
368
gphLoading ,
@@ -389,7 +373,6 @@ export const usePositionsAndFeesComputation = () => {
389
373
setClosedPositions ,
390
374
setDepositedSqueeth ,
391
375
setDepositedWeth ,
392
- setLoading ,
393
376
setSqueethLiquidity ,
394
377
setWethLiquidity ,
395
378
setWithdrawnSqueeth ,
0 commit comments