mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-22 17:33:23 +01:00
Fix: multiple reject on the signature request screen (#16199)
Co-authored-by: Brad Decker <bhdecker84@gmail.com>
This commit is contained in:
parent
9a434aed5e
commit
505517e8c7
6
app/_locales/en/messages.json
generated
6
app/_locales/en/messages.json
generated
@ -2889,6 +2889,12 @@
|
||||
"rejectAll": {
|
||||
"message": "Reject all"
|
||||
},
|
||||
"rejectRequestsDescription": {
|
||||
"message": "You are about to batch reject $1 requests."
|
||||
},
|
||||
"rejectRequestsN": {
|
||||
"message": "Reject $1 requests"
|
||||
},
|
||||
"rejectTxsDescription": {
|
||||
"message": "You are about to batch reject $1 transactions."
|
||||
},
|
||||
|
@ -11,6 +11,7 @@ export default class RejectTransactionsModal extends PureComponent {
|
||||
onSubmit: PropTypes.func.isRequired,
|
||||
hideModal: PropTypes.func.isRequired,
|
||||
unapprovedTxCount: PropTypes.number.isRequired,
|
||||
isRequestType: PropTypes.bool,
|
||||
};
|
||||
|
||||
onSubmit = async () => {
|
||||
@ -22,11 +23,15 @@ export default class RejectTransactionsModal extends PureComponent {
|
||||
|
||||
render() {
|
||||
const { t } = this.context;
|
||||
const { hideModal, unapprovedTxCount } = this.props;
|
||||
const { hideModal, unapprovedTxCount, isRequestType } = this.props;
|
||||
|
||||
return (
|
||||
<Modal
|
||||
headerText={t('rejectTxsN', [unapprovedTxCount])}
|
||||
headerText={
|
||||
isRequestType
|
||||
? t('rejectRequestsN', [unapprovedTxCount])
|
||||
: t('rejectTxsN', [unapprovedTxCount])
|
||||
}
|
||||
onClose={hideModal}
|
||||
onSubmit={this.onSubmit}
|
||||
onCancel={hideModal}
|
||||
@ -35,7 +40,9 @@ export default class RejectTransactionsModal extends PureComponent {
|
||||
>
|
||||
<div>
|
||||
<div className="reject-transactions__description">
|
||||
{t('rejectTxsDescription', [unapprovedTxCount])}
|
||||
{isRequestType
|
||||
? t('rejectRequestsDescription', [unapprovedTxCount])
|
||||
: t('rejectTxsDescription', [unapprovedTxCount])}
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
|
@ -179,7 +179,7 @@ exports[`SignatureRequestOriginal should match snapshot 1`] = `
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
Cancel
|
||||
Reject
|
||||
</button>
|
||||
<button
|
||||
class="button btn--rounded btn-primary btn--large request-signature__footer__sign-button"
|
||||
|
@ -291,7 +291,7 @@ export default class SignatureRequestOriginal extends Component {
|
||||
history.push(mostRecentOverviewPage);
|
||||
}}
|
||||
>
|
||||
{t('cancel')}
|
||||
{t('reject')}
|
||||
</Button>
|
||||
<Button
|
||||
data-testid="request-signature__sign"
|
||||
@ -344,7 +344,7 @@ export default class SignatureRequestOriginal extends Component {
|
||||
render = () => {
|
||||
const { messagesCount } = this.props;
|
||||
const { t } = this.context;
|
||||
const rejectNText = t('rejectTxsN', [messagesCount]);
|
||||
const rejectNText = t('rejectRequestsN', [messagesCount]);
|
||||
return (
|
||||
<div className="request-signature__container">
|
||||
{this.renderHeader()}
|
||||
|
@ -61,6 +61,7 @@ function mapDispatchToProps(dispatch) {
|
||||
name: 'REJECT_TRANSACTIONS',
|
||||
onSubmit,
|
||||
unapprovedTxCount: messagesCount,
|
||||
isRequestType: true,
|
||||
}),
|
||||
);
|
||||
},
|
||||
|
@ -22,7 +22,7 @@ export default class SignatureRequestFooter extends PureComponent {
|
||||
type="secondary"
|
||||
data-testid="signature-cancel-button"
|
||||
>
|
||||
{this.context.t('cancel')}
|
||||
{this.context.t('reject')}
|
||||
</Button>
|
||||
<Button
|
||||
onClick={signAction}
|
||||
|
Loading…
Reference in New Issue
Block a user