Skip to content

Commit

Permalink
fix: allow cancellation after expiration (#2902)
Browse files Browse the repository at this point in the history
* fix: allow cancellation after expiration

* fix: ternary

* fix: adjust flag
  • Loading branch information
iamacook authored Nov 28, 2023
1 parent 219ff05 commit e9e0974
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/components/recovery/CancelRecoveryButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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()
Expand Down Expand Up @@ -61,7 +59,7 @@ export function CancelRecoveryButton({
return (
<CheckWallet allowNonOwner>
{(isOk) => {
const isDisabled = !isOk || (isGuardian && !isExpired)
const isDisabled = isOwner ? !isOk : !isOk || !isExpired

return compact ? (
<IconButton onClick={onClick} color="error" size="small" disabled={isDisabled}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/settings/Recovery/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const headCells = [
label: (
<>
Recovery delay{' '}
<Tooltip title="You can cancel any recovery attempt when it is not needed or wanted within the delay period.">
<Tooltip title="You can cancel any recovery attempt when it is not needed or wanted.">
<span>
<SvgIcon
component={InfoIcon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,7 @@ export function UpsertRecoveryFlowReview({
title={
<>
Recovery delay
<Tooltip
placement="top"
title="You can cancel any recovery attempt when it is not needed or wanted within the delay period."
>
<Tooltip placement="top" title="You can cancel any recovery attempt when it is not needed or wanted.">
<span>
<SvgIcon
component={InfoIcon}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export function UpsertRecoveryFlowSettings({
</Typography>

<Typography variant="body2">
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.
</Typography>
</div>

Expand Down

0 comments on commit e9e0974

Please sign in to comment.