Skip to content

Commit

Permalink
fix(Redeem): redeem limit when there is not capcity (#1451)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsimao authored Jul 14, 2023
1 parent aa9470e commit d97bd0b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils/hooks/api/bridge/use-get-redeem-data.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { InterbtcPrimitivesVaultId } from '@interlay/interbtc-api';
import { InterbtcPrimitivesVaultId, newMonetaryAmount } from '@interlay/interbtc-api';
import { Currency, MonetaryAmount } from '@interlay/monetary-js';
import Big from 'big.js';
import { useCallback } from 'react';
import { useErrorHandler } from 'react-error-boundary';
import { useQuery } from 'react-query';

import { RELAY_CHAIN_NATIVE_TOKEN } from '@/config/relay-chains';
import { RELAY_CHAIN_NATIVE_TOKEN, WRAPPED_TOKEN } from '@/config/relay-chains';
import { BLOCKTIME_REFETCH_INTERVAL } from '@/utils/constants/api';

import { useGetExchangeRate } from '../use-get-exchange-rate';
Expand Down Expand Up @@ -41,9 +41,9 @@ const getRedeemData = async (): Promise<RedeemData> => {
window.bridge.vaults.getVaultsWithRedeemableTokens()
]);

const redeemLimit = vaultsWithRedeemableTokens.values().next().value;
const redeemLimit = vaultsWithRedeemableTokens.values().next().value || newMonetaryAmount(0, WRAPPED_TOKEN);

const premiumRedeemLimit = premiumRedeemVaults.values().next().value;
const premiumRedeemLimit = premiumRedeemVaults.values().next().value || newMonetaryAmount(0, WRAPPED_TOKEN);

const premium = premiumRedeemLimit
? {
Expand Down

2 comments on commit d97bd0b

@vercel
Copy link

@vercel vercel bot commented on d97bd0b Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on d97bd0b Jul 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.