Ensure approval warning for setApprovalForAll is not shown when revoking (#15806)

Co-authored-by: ryanml <ryanlanese@gmail.com>
feature/default_network_editable
Dan J Miller 2 years ago committed by seaona
parent ba11a4b5ad
commit 7054dd6694
  1. 4
      ui/components/app/confirm-page-container/confirm-page-container.component.js
  2. 1
      ui/pages/confirm-approve/confirm-approve.js
  3. 3
      ui/pages/confirm-transaction-base/confirm-transaction-base.component.js

@ -97,6 +97,7 @@ export default class ConfirmPageContainer extends Component {
nativeCurrency: PropTypes.string,
showBuyModal: PropTypes.func,
isBuyableChain: PropTypes.bool,
setApproveForAllArg: PropTypes.bool,
};
render() {
@ -153,6 +154,7 @@ export default class ConfirmPageContainer extends Component {
showBuyModal,
isBuyableChain,
networkIdentifier,
setApproveForAllArg,
} = this.props;
const showAddToAddressDialog =
@ -306,7 +308,7 @@ export default class ConfirmPageContainer extends Component {
<ErrorMessage errorKey={errorKey} />
</div>
)}
{isSetApproveForAll && (
{isSetApproveForAll && !setApproveForAllArg && (
<Dialog type="error" className="confirm-page-container__dialog">
{t('confirmPageDialogSetApprovalForAll')}
</Dialog>

@ -172,6 +172,7 @@ export default function ConfirmApprove({
customTokenAmount={String(customPermissionAmount)}
dappProposedTokenAmount={tokenAmount}
currentTokenBalance={tokenBalance}
setApproveForAllArg={setApproveForAllArg}
contentComponent={
<TransactionModalContextProvider>
<ConfirmApproveContent

@ -151,6 +151,7 @@ export default class ConfirmTransactionBase extends Component {
eip1559V2Enabled: PropTypes.bool,
showBuyModal: PropTypes.func,
isBuyableChain: PropTypes.bool,
setApproveForAllArg: PropTypes.bool,
};
state = {
@ -1048,6 +1049,7 @@ export default class ConfirmTransactionBase extends Component {
nativeCurrency,
hardwareWalletRequiresConnection,
image,
setApproveForAllArg,
} = this.props;
const {
submitting,
@ -1148,6 +1150,7 @@ export default class ConfirmTransactionBase extends Component {
currentTransaction={txData}
supportsEIP1559V2={this.supportsEIP1559V2}
nativeCurrency={nativeCurrency}
setApproveForAllArg={setApproveForAllArg}
/>
</TransactionModalContextProvider>
);

Loading…
Cancel
Save