Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow cancellation after expiration #2902

Merged
merged 3 commits into from
Nov 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/components/recovery/CancelRecoveryButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import useSafeInfo from '@/hooks/useSafeInfo'
import useOnboard from '@/hooks/wallets/useOnboard'
import { logError, Errors } from '@/services/exceptions'
import { RecoveryContext } from '../RecoveryContext'
import { useIsGuardian } from '@/hooks/useIsGuardian'
import { useRecoveryTxState } from '@/hooks/useRecoveryTxState'
import type { RecoveryQueueItem } from '@/services/recovery/recovery-state'

Expand All @@ -25,7 +24,6 @@ export function CancelRecoveryButton({
compact?: boolean
}): ReactElement {
const isOwner = useIsSafeOwner()
const isGuardian = useIsGuardian()
const { isExpired } = useRecoveryTxState(recovery)
const { setTxFlow } = useContext(TxModalContext)
const onboard = useOnboard()
Expand Down Expand Up @@ -55,7 +53,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.">
Copy link
Member Author

Choose a reason for hiding this comment

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

We should extract these to a constant as they are the same throughout the app but I'd suggest so in a separate PR to avoid inflating the scope of this.

<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
Loading