Skip to content

Commit

Permalink
try to fix position observable
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Nov 9, 2023
1 parent a70953b commit 0a8623a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/network/cardano/api/positions/positions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import {
combineLatest,
debounceTime,
filter,
first,
map,
publishReplay,
refCount,
Expand All @@ -16,6 +18,7 @@ import {
unverifiedAmmPools$,
} from '../ammPools/ammPools';
import { lpBalance$ } from '../balance/lpBalance';
import { networkAssetBalance$ } from '../balance/networkAssetBalance.ts';
import { networkContext$ } from '../networkContext/networkContext';

export const positions$ = combineLatest([
Expand All @@ -27,7 +30,11 @@ export const positions$ = combineLatest([
return allAmmPools$;
}),
),
lpBalance$.pipe(startWith(new Balance([]))),
networkAssetBalance$.pipe(
filter(Boolean),
first(),
switchMap(() => lpBalance$.pipe(startWith(new Balance([])))),
),
networkContext$,
]).pipe(
debounceTime(200),
Expand Down

0 comments on commit 0a8623a

Please sign in to comment.