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 2 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
2 changes: 1 addition & 1 deletion src/components/recovery/CancelRecoveryButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function CancelRecoveryButton({
return (
<CheckWallet allowNonOwner>
{(isOk) => {
const isDisabled = !isOk || (isGuardian && !isExpired)
const isDisabled = isOwner ? !isOk : !isOk && !isExpired
Copy link
Member

Choose a reason for hiding this comment

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

This makes it possible to cancel a recovery tx as a non-owner before it has expired. I assume that tx would fail so I suggest to still disable it.

Copy link
Member Author

Choose a reason for hiding this comment

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

I've tweaked the logic in 6c7fca8 to only disable if not expired as non-owners are able to skip expired transactions


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