From e9e09746b99951473c8bc25b23f62f65cd93c713 Mon Sep 17 00:00:00 2001 From: Aaron Cook Date: Tue, 28 Nov 2023 17:25:51 +0100 Subject: [PATCH] fix: allow cancellation after expiration (#2902) * fix: allow cancellation after expiration * fix: ternary * fix: adjust flag --- src/components/recovery/CancelRecoveryButton/index.tsx | 4 +--- src/components/settings/Recovery/index.tsx | 2 +- .../flows/UpsertRecovery/UpsertRecoveryFlowReview.tsx | 5 +---- .../flows/UpsertRecovery/UpsertRecoveryFlowSettings.tsx | 2 +- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/components/recovery/CancelRecoveryButton/index.tsx b/src/components/recovery/CancelRecoveryButton/index.tsx index 4123b300e0..634d68659b 100644 --- a/src/components/recovery/CancelRecoveryButton/index.tsx +++ b/src/components/recovery/CancelRecoveryButton/index.tsx @@ -14,7 +14,6 @@ import useOnboard from '@/hooks/wallets/useOnboard' import { trackError, Errors } from '@/services/exceptions' import { asError } from '@/services/exceptions/utils' import { RecoveryContext } from '../RecoveryContext' -import { useIsGuardian } from '@/hooks/useIsGuardian' import { useRecoveryTxState } from '@/hooks/useRecoveryTxState' import { RecoveryListItemContext } from '../RecoveryListItem/RecoveryListItemContext' import type { RecoveryQueueItem } from '@/services/recovery/recovery-state' @@ -28,7 +27,6 @@ export function CancelRecoveryButton({ }): ReactElement { const { setSubmitError } = useContext(RecoveryListItemContext) const isOwner = useIsSafeOwner() - const isGuardian = useIsGuardian() const { isExpired } = useRecoveryTxState(recovery) const { setTxFlow } = useContext(TxModalContext) const onboard = useOnboard() @@ -61,7 +59,7 @@ export function CancelRecoveryButton({ return ( {(isOk) => { - const isDisabled = !isOk || (isGuardian && !isExpired) + const isDisabled = isOwner ? !isOk : !isOk || !isExpired return compact ? ( diff --git a/src/components/settings/Recovery/index.tsx b/src/components/settings/Recovery/index.tsx index 394a2fa854..24183298fc 100644 --- a/src/components/settings/Recovery/index.tsx +++ b/src/components/settings/Recovery/index.tsx @@ -32,7 +32,7 @@ const headCells = [ label: ( <> Recovery delay{' '} - + Recovery delay - + - You can cancel any recovery attempt when it is not needed or wanted within the delay period. + You can cancel any recovery attempt when it is not needed or wanted.