Skip to content

Commit

Permalink
update token locks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Mar 22, 2024
1 parent 734f3ed commit 2ec5abc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/network/cardano/api/common/tokenLocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import groupBy from 'lodash/groupBy';
import last from 'lodash/last';
import uniq from 'lodash/uniq';
import uniqBy from 'lodash/uniqBy';
import { combineLatest, defer, map, of, switchMap } from 'rxjs';
import { combineLatest, map, of, switchMap } from 'rxjs';

import { appTick$ } from '../../../../common/streams/appTick.ts';
import { PoolId } from '../../../../common/types.ts';
Expand All @@ -26,7 +26,8 @@ const getLocksByPaymentCreds = (creds: string[]): Promise<CardanoTokenLock[]> =>
.then((res) => res.data)
.catch(() => [] as CardanoTokenLock[]);

export const locks$ = defer(() => getAddresses()).pipe(
export const locks$ = appTick$.pipe(
switchMap(() => getAddresses()),
switchMap((addresses) => {
if (addresses.length > 0) {
const creds = uniq(
Expand Down

0 comments on commit 2ec5abc

Please sign in to comment.