From 4ed21536ec7016cb3d5fcba9749b66b52000dbb2 Mon Sep 17 00:00:00 2001 From: Onno Visser <23527729+onnovisser@users.noreply.github.com> Date: Mon, 16 Dec 2024 13:11:24 +0100 Subject: [PATCH] fix allowance check --- .../components/InvestRedeem/InvestRedeemTinlakeProvider.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/centrifuge-app/src/components/InvestRedeem/InvestRedeemTinlakeProvider.tsx b/centrifuge-app/src/components/InvestRedeem/InvestRedeemTinlakeProvider.tsx index efb14be269..90d5a193b1 100644 --- a/centrifuge-app/src/components/InvestRedeem/InvestRedeemTinlakeProvider.tsx +++ b/centrifuge-app/src/components/InvestRedeem/InvestRedeemTinlakeProvider.tsx @@ -131,8 +131,8 @@ export function InvestRedeemTinlakeProvider({ poolId, trancheId, children }: Pro ? 'invest' : null, needsToCollectBeforeOrder: !collectAmount.isZero(), - needsPoolCurrencyApproval: () => !!trancheInvestment?.poolCurrencyAllowance.isZero(), - needsTrancheTokenApproval: () => !!trancheInvestment?.tokenAllowance.isZero(), + needsPoolCurrencyApproval: (amount) => Dec(amount).gt(trancheInvestment?.poolCurrencyAllowance ?? 0), + needsTrancheTokenApproval: (amount) => Dec(amount).gt(trancheInvestment?.tokenAllowance ?? 0), canChangeOrder: true, canCancelOrder: true, pendingAction,