Skip to content

Commit

Permalink
chore: Cherry pick 5849444 (#11007)
Browse files Browse the repository at this point in the history
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->

## **Description**

chore: Cherry pick 5849444

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.

Co-authored-by: Matthew Walsh <[email protected]>
  • Loading branch information
sethkfman and matthewwalsh0 authored Sep 3, 2024
1 parent 4180cd5 commit 22a1919
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
4 changes: 2 additions & 2 deletions app/components/Views/confirmations/SendFlow/Confirm/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ import CustomGasModal from './components/CustomGasModal';
import { ResultType } from '../../components/BlockaidBanner/BlockaidBanner.types';
import { withMetricsAwareness } from '../../../../../components/hooks/useMetrics';
import {
selectTransactionGasFeeEstimates,
selectCurrentTransactionMetadata,
selectGasFeeEstimates,
} from '../../../../../selectors/confirmTransaction';
import { selectGasFeeControllerEstimateType } from '../../../../../selectors/gasFeeController';
import { createBuyNavigationDetails } from '../../../../UI/Ramp/routes/utils';
Expand Down Expand Up @@ -1475,7 +1475,7 @@ const mapStateToProps = (state) => ({
selectedAsset: state.transaction.selectedAsset,
transactionState: state.transaction,
primaryCurrency: state.settings.primaryCurrency,
gasFeeEstimates: selectTransactionGasFeeEstimates(state),
gasFeeEstimates: selectGasFeeEstimates(state),
gasEstimateType: selectGasFeeControllerEstimateType(state),
isPaymentRequest: state.transaction.paymentRequest,
securityAlertResponse:
Expand Down
1 change: 1 addition & 0 deletions app/core/Engine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1540,6 +1540,7 @@ class Engine {
this.configureControllersOnNetworkChange();
this.startPolling();
this.handleVaultBackup();
this.transactionController.clearUnapprovedTransactions();

Engine.instance = this;
}
Expand Down
12 changes: 0 additions & 12 deletions app/selectors/confirmTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ const selectCurrentTransactionGasFeeEstimatesStrict = createSelector(
(transactionMetadata) => transactionMetadata?.gasFeeEstimates,
);

const selectCurrentTransactionGasFeeEstimatesLoaded = createSelector(
selectCurrentTransactionMetadata,
(transactionMetadata) => transactionMetadata?.gasFeeEstimatesLoaded,
);

export const selectCurrentTransactionGasFeeEstimates = createDeepEqualSelector(
selectCurrentTransactionGasFeeEstimatesStrict,
(gasFeeEstimates) => gasFeeEstimates,
Expand All @@ -45,10 +40,3 @@ export const selectGasFeeEstimates = createSelector(
return gasFeeControllerEstimates;
},
);

export const selectTransactionGasFeeEstimates = createSelector(
selectCurrentTransactionGasFeeEstimatesLoaded,
selectGasFeeEstimates,
(transactionGasFeeEstimatesLoaded, gasFeeEstimates) =>
transactionGasFeeEstimatesLoaded ? gasFeeEstimates : undefined,
);

0 comments on commit 22a1919

Please sign in to comment.