mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Renamed setApproveForAllArg variable to be isApprovalOrRejection (#16012)
This commit is contained in:
parent
393088e669
commit
76af0f4d4f
@ -108,7 +108,7 @@ export default class ConfirmPageContainer extends Component {
|
||||
nativeCurrency: PropTypes.string,
|
||||
showBuyModal: PropTypes.func,
|
||||
isBuyableChain: PropTypes.bool,
|
||||
setApproveForAllArg: PropTypes.bool,
|
||||
isApprovalOrRejection: PropTypes.bool,
|
||||
};
|
||||
|
||||
render() {
|
||||
@ -165,7 +165,7 @@ export default class ConfirmPageContainer extends Component {
|
||||
showBuyModal,
|
||||
isBuyableChain,
|
||||
networkIdentifier,
|
||||
setApproveForAllArg,
|
||||
isApprovalOrRejection,
|
||||
///: BEGIN:ONLY_INCLUDE_IN(flask)
|
||||
insightComponent,
|
||||
///: END:ONLY_INCLUDE_IN
|
||||
@ -339,7 +339,7 @@ export default class ConfirmPageContainer extends Component {
|
||||
<ErrorMessage errorKey={errorKey} />
|
||||
</div>
|
||||
)}
|
||||
{isSetApproveForAll && setApproveForAllArg && (
|
||||
{isSetApproveForAll && isApprovalOrRejection && (
|
||||
<Dialog type="error" className="confirm-page-container__dialog">
|
||||
{/*
|
||||
TODO: https://github.com/MetaMask/metamask-extension/issues/15745
|
||||
|
@ -75,7 +75,7 @@ export default class ConfirmApproveContent extends Component {
|
||||
tokenId: PropTypes.string,
|
||||
assetStandard: PropTypes.string,
|
||||
isSetApproveForAll: PropTypes.bool,
|
||||
setApproveForAllArg: PropTypes.bool,
|
||||
isApprovalOrRejection: PropTypes.bool,
|
||||
userAddress: PropTypes.string,
|
||||
};
|
||||
|
||||
@ -307,7 +307,7 @@ export default class ConfirmApproveContent extends Component {
|
||||
|
||||
renderDataContent() {
|
||||
const { t } = this.context;
|
||||
const { data, isSetApproveForAll, setApproveForAllArg } = this.props;
|
||||
const { data, isSetApproveForAll, isApprovalOrRejection } = this.props;
|
||||
return (
|
||||
<div className="flex-column">
|
||||
<div className="confirm-approve-content__small-text">
|
||||
@ -315,9 +315,9 @@ export default class ConfirmApproveContent extends Component {
|
||||
? t('functionSetApprovalForAll')
|
||||
: t('functionApprove')}
|
||||
</div>
|
||||
{isSetApproveForAll && setApproveForAllArg !== undefined ? (
|
||||
{isSetApproveForAll && isApprovalOrRejection !== undefined ? (
|
||||
<div className="confirm-approve-content__small-text">
|
||||
{`${t('parameters')}: ${setApproveForAllArg}`}
|
||||
{`${t('parameters')}: ${isApprovalOrRejection}`}
|
||||
</div>
|
||||
) : null}
|
||||
<div className="confirm-approve-content__small-text confirm-approve-content__data__data-block">
|
||||
@ -531,14 +531,14 @@ export default class ConfirmApproveContent extends Component {
|
||||
|
||||
renderTitle() {
|
||||
const { t } = this.context;
|
||||
const { isSetApproveForAll, setApproveForAllArg } = this.props;
|
||||
const { isSetApproveForAll, isApprovalOrRejection } = this.props;
|
||||
const titleTokenDescription = this.getTitleTokenDescription();
|
||||
|
||||
let title;
|
||||
|
||||
if (isSetApproveForAll) {
|
||||
title = t('approveAllTokensTitle', [titleTokenDescription]);
|
||||
if (setApproveForAllArg === false) {
|
||||
if (isApprovalOrRejection === false) {
|
||||
title = t('revokeAllTokensTitle', [titleTokenDescription]);
|
||||
}
|
||||
}
|
||||
@ -547,14 +547,15 @@ export default class ConfirmApproveContent extends Component {
|
||||
|
||||
renderDescription() {
|
||||
const { t } = this.context;
|
||||
const { isContract, isSetApproveForAll, setApproveForAllArg } = this.props;
|
||||
const { isContract, isSetApproveForAll, isApprovalOrRejection } =
|
||||
this.props;
|
||||
const grantee = isContract
|
||||
? t('contract').toLowerCase()
|
||||
: t('account').toLowerCase();
|
||||
|
||||
let description = t('trustSiteApprovePermission', [grantee]);
|
||||
|
||||
if (isSetApproveForAll && setApproveForAllArg === false) {
|
||||
if (isSetApproveForAll && isApprovalOrRejection === false) {
|
||||
description = t('revokeApproveForAllDescription', [
|
||||
grantee,
|
||||
this.getTitleTokenDescription(),
|
||||
|
@ -155,7 +155,7 @@ export default function ConfirmApprove({
|
||||
|
||||
const parsedTransactionData =
|
||||
parseStandardTokenTransactionData(transactionData);
|
||||
const setApproveForAllArg = getTokenApprovedParam(parsedTransactionData);
|
||||
const isApprovalOrRejection = getTokenApprovedParam(parsedTransactionData);
|
||||
|
||||
return tokenSymbol === undefined && assetName === undefined ? (
|
||||
<Loading />
|
||||
@ -170,13 +170,13 @@ export default function ConfirmApprove({
|
||||
customTokenAmount={String(customPermissionAmount)}
|
||||
dappProposedTokenAmount={tokenAmount}
|
||||
currentTokenBalance={tokenBalance}
|
||||
setApproveForAllArg={setApproveForAllArg}
|
||||
isApprovalOrRejection={isApprovalOrRejection}
|
||||
contentComponent={
|
||||
<TransactionModalContextProvider>
|
||||
<ConfirmApproveContent
|
||||
userAddress={userAddress}
|
||||
isSetApproveForAll={isSetApproveForAll}
|
||||
setApproveForAllArg={setApproveForAllArg}
|
||||
isApprovalOrRejection={isApprovalOrRejection}
|
||||
decimals={decimals}
|
||||
siteImage={siteImage}
|
||||
setCustomAmount={setCustomPermissionAmount}
|
||||
|
@ -161,7 +161,7 @@ export default class ConfirmTransactionBase extends Component {
|
||||
eip1559V2Enabled: PropTypes.bool,
|
||||
showBuyModal: PropTypes.func,
|
||||
isBuyableChain: PropTypes.bool,
|
||||
setApproveForAllArg: PropTypes.bool,
|
||||
isApprovalOrRejection: PropTypes.bool,
|
||||
///: BEGIN:ONLY_INCLUDE_IN(flask)
|
||||
insightSnaps: PropTypes.arrayOf(PropTypes.object),
|
||||
///: END:ONLY_INCLUDE_IN
|
||||
@ -1127,7 +1127,7 @@ export default class ConfirmTransactionBase extends Component {
|
||||
nativeCurrency,
|
||||
hardwareWalletRequiresConnection,
|
||||
image,
|
||||
setApproveForAllArg,
|
||||
isApprovalOrRejection,
|
||||
assetStandard,
|
||||
} = this.props;
|
||||
const {
|
||||
@ -1232,7 +1232,7 @@ export default class ConfirmTransactionBase extends Component {
|
||||
currentTransaction={txData}
|
||||
supportsEIP1559V2={this.supportsEIP1559V2}
|
||||
nativeCurrency={nativeCurrency}
|
||||
setApproveForAllArg={setApproveForAllArg}
|
||||
isApprovalOrRejection={isApprovalOrRejection}
|
||||
assetStandard={assetStandard}
|
||||
/>
|
||||
</TransactionModalContextProvider>
|
||||
|
Loading…
Reference in New Issue
Block a user