From 8a0261502768ba460d314e4b79170d055df09931 Mon Sep 17 00:00:00 2001
From: Onno Visser <23527729+onnovisser@users.noreply.github.com>
Date: Mon, 18 Sep 2023 11:30:15 +0200
Subject: [PATCH] disable cancel
---
.../components/InvestRedeem/InvestRedeem.tsx | 22 ++++++++++---------
.../InvestRedeemCentrifugeProvider.tsx | 1 +
.../InvestRedeemLiquidityPoolsProvider.tsx | 1 +
.../InvestRedeemTinlakeProvider.tsx | 1 +
.../src/components/InvestRedeem/types.ts | 1 +
5 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/centrifuge-app/src/components/InvestRedeem/InvestRedeem.tsx b/centrifuge-app/src/components/InvestRedeem/InvestRedeem.tsx
index 51e2683bbe..c2672f51b3 100644
--- a/centrifuge-app/src/components/InvestRedeem/InvestRedeem.tsx
+++ b/centrifuge-app/src/components/InvestRedeem/InvestRedeem.tsx
@@ -830,16 +830,18 @@ const PendingOrder: React.FC<{
Learn more
-
-
- {isCancelling ? (
-
- ) : (
-
- Cancel
-
- )}
-
+
+ {state.canCancelOrder && (
+
+ {isCancelling ? (
+
+ ) : (
+
+ Cancel
+
+ )}
+
+ )}
{state.canChangeOrder && (
diff --git a/centrifuge-app/src/components/InvestRedeem/InvestRedeemCentrifugeProvider.tsx b/centrifuge-app/src/components/InvestRedeem/InvestRedeemCentrifugeProvider.tsx
index 87e3fc2fb5..ff4e56e886 100644
--- a/centrifuge-app/src/components/InvestRedeem/InvestRedeemCentrifugeProvider.tsx
+++ b/centrifuge-app/src/components/InvestRedeem/InvestRedeemCentrifugeProvider.tsx
@@ -116,6 +116,7 @@ export function InvestRedeemCentrifugeProvider({ poolId, trancheId, children }:
needsPoolCurrencyApproval: () => false,
needsTrancheTokenApproval: () => false,
canChangeOrder: true,
+ canCancelOrder: true,
pendingAction,
pendingTransaction,
}
diff --git a/centrifuge-app/src/components/InvestRedeem/InvestRedeemLiquidityPoolsProvider.tsx b/centrifuge-app/src/components/InvestRedeem/InvestRedeemLiquidityPoolsProvider.tsx
index 6897a4bb2f..9329fd70b8 100644
--- a/centrifuge-app/src/components/InvestRedeem/InvestRedeemLiquidityPoolsProvider.tsx
+++ b/centrifuge-app/src/components/InvestRedeem/InvestRedeemLiquidityPoolsProvider.tsx
@@ -163,6 +163,7 @@ export function InvestRedeemLiquidityPoolsProvider({ poolId, trancheId, children
? lpInvest.managerTrancheTokenAllowance.toFloat() < amount && !lpInvest.trancheTokenSupportsPermit
: false,
canChangeOrder: false,
+ canCancelOrder: false,
pendingAction,
pendingTransaction,
statusMessage: undefined,
diff --git a/centrifuge-app/src/components/InvestRedeem/InvestRedeemTinlakeProvider.tsx b/centrifuge-app/src/components/InvestRedeem/InvestRedeemTinlakeProvider.tsx
index d463fa38a2..dbfa7478dc 100644
--- a/centrifuge-app/src/components/InvestRedeem/InvestRedeemTinlakeProvider.tsx
+++ b/centrifuge-app/src/components/InvestRedeem/InvestRedeemTinlakeProvider.tsx
@@ -126,6 +126,7 @@ export function InvestRedeemTinlakeProvider({ poolId, trancheId, children }: Pro
needsPoolCurrencyApproval: () => !!trancheInvestment?.poolCurrencyAllowance.isZero(),
needsTrancheTokenApproval: () => !!trancheInvestment?.tokenAllowance.isZero(),
canChangeOrder: true,
+ canCancelOrder: true,
pendingAction,
pendingTransaction,
}
diff --git a/centrifuge-app/src/components/InvestRedeem/types.ts b/centrifuge-app/src/components/InvestRedeem/types.ts
index 56c56af311..29918ade0d 100644
--- a/centrifuge-app/src/components/InvestRedeem/types.ts
+++ b/centrifuge-app/src/components/InvestRedeem/types.ts
@@ -48,6 +48,7 @@ export type InvestRedeemState = {
needsPoolCurrencyApproval: (amount: number) => boolean
needsTrancheTokenApproval: (amount: number) => boolean
canChangeOrder: boolean
+ canCancelOrder: boolean
pendingAction?: InvestRedeemAction | null
pendingTransaction?: Transaction | null
statusMessage?: string