Skip to content

Commit

Permalink
[MMI] passing the selectedAddress field (#21617)
Browse files Browse the repository at this point in the history
## **Description**

In MMI we need the address selected to be sent in the properties, so in
order to have that we get the `selectedAddress` from preferences state
and pass it to the `mmiProps` object.


## **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**

- [x] I’ve followed [MetaMask Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/develop/.github/guidelines/CODING_GUIDELINES.md).
- [x] I've clearly explained:
  - [x] What problem this PR is solving.
  - [x] How this problem was solved.
  - [x] How reviewers can test my changes.

## **Pre-merge reviewer checklist**

- [x] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [x] 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.
  • Loading branch information
zone-live authored Nov 2, 2023
1 parent e769167 commit 2bda081
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/scripts/controllers/metametrics.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ export default class MetaMetricsController {
this.extension = extension;
this.environment = environment;

///: BEGIN:ONLY_INCLUDE_IN(build-mmi)
this.selectedAddress = prefState.selectedAddress;
///: END:ONLY_INCLUDE_IN

const abandonedFragments = omitBy(initState?.fragments, 'persist');
const segmentApiCalls = initState?.segmentApiCalls || {};

Expand Down Expand Up @@ -712,6 +716,10 @@ export default class MetaMetricsController {
if (this.extension?.runtime?.id) {
mmiProps.extensionId = this.extension.runtime.id;
}

if (this.selectedAddres) {
mmiProps.accountAddress = this.selectedAddres;
}
///: END:ONLY_INCLUDE_IN

return {
Expand Down

0 comments on commit 2bda081

Please sign in to comment.