-
Notifications
You must be signed in to change notification settings - Fork 476
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: add chain check in Delete Tx modal #4656
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,8 @@ import { txDispatch, TxEvent } from '@/services/tx/txEvents' | |
import { REJECT_TX_EVENTS } from '@/services/analytics/events/reject-tx' | ||
import { trackEvent } from '@/services/analytics' | ||
import { isWalletRejection } from '@/utils/wallets' | ||
import CheckWallet from '@/components/common/CheckWallet' | ||
import ChainSwitcher from '@/components/common/ChainSwitcher' | ||
|
||
type DeleteTxModalProps = { | ||
safeTxHash: string | ||
|
@@ -122,6 +124,10 @@ const InternalDeleteTxModal = ({ | |
related to deleting a transaction off-chain. | ||
</Box> | ||
|
||
<Box mt={2}> | ||
<ChainSwitcher /> | ||
</Box> | ||
|
||
{error && ( | ||
<Box mt={2}> | ||
<ErrorMessage error={error}>Error deleting transaction</ErrorMessage> | ||
|
@@ -136,17 +142,21 @@ const InternalDeleteTxModal = ({ | |
Keep it | ||
</Button> | ||
|
||
<Button | ||
data-testid="delete-tx-btn" | ||
size="small" | ||
variant="contained" | ||
color="primary" | ||
onClick={onConfirm} | ||
disabled={isLoading} | ||
sx={{ minWidth: '122px', minHeight: '36px' }} | ||
> | ||
{isLoading ? <CircularProgress size={20} /> : 'Yes, delete'} | ||
</Button> | ||
<CheckWallet checkNetwork> | ||
{(isOk) => ( | ||
<Button | ||
data-testid="delete-tx-btn" | ||
size="small" | ||
variant="contained" | ||
color="primary" | ||
onClick={onConfirm} | ||
disabled={!isOk || isLoading} | ||
sx={{ minWidth: '122px', minHeight: '36px' }} | ||
> | ||
{isLoading ? <CircularProgress size={20} /> : 'Yes, delete'} | ||
</Button> | ||
)} | ||
</CheckWallet> | ||
</DialogActions> | ||
</Dialog> | ||
) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -79,7 +79,7 @@ const DeleteTxButton = ({ | |
<Tooltip | ||
arrow | ||
placement="top" | ||
title={isDeletable ? '' : 'You can only delete the last transaction in the queue or duplicates'} | ||
title={isDeletable ? '' : 'You can only delete the last transaction in the queue, or a duplicate transaction.'} | ||
> | ||
<span style={{ width: '100%' }}> | ||
<Track {...REJECT_TX_EVENTS.DELETE_OFFCHAIN_BUTTON} as="div"> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider extracting the inline style for the |
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we extend this component to avoid "inline" styles?