Skip to content

Commit

Permalink
Merge branch 'develop' into feat/address-book-petnames-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewwalsh0 authored Oct 3, 2023
2 parents ab443a3 + ab0fdee commit 4aa826b
Show file tree
Hide file tree
Showing 71 changed files with 1,689 additions and 569 deletions.
6 changes: 2 additions & 4 deletions app/_locales/de/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/el/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 27 additions & 4 deletions app/_locales/en/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/es/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/fr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/hi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/id/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/ja/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/ko/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/pt/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/ru/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/tl/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/tr/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/vi/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions app/_locales/zh_CN/messages.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added app/images/token-list-buy-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/token-list-nfts-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/images/token-list-receive-background.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 2 additions & 41 deletions app/scripts/controllers/mmi-controller.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import EventEmitter from 'events';
import log from 'loglevel';
import { captureException } from '@sentry/browser';
import { isEqual } from 'lodash';
import { CUSTODIAN_TYPES } from '@metamask-institutional/custody-keyring';
import {
updateCustodianTransactions,
Expand All @@ -11,17 +10,10 @@ import {
REFRESH_TOKEN_CHANGE_EVENT,
INTERACTIVE_REPLACEMENT_TOKEN_CHANGE_EVENT,
} from '@metamask-institutional/sdk';
import {
handleMmiPortfolio,
setDashboardCookie,
} from '@metamask-institutional/portfolio-dashboard';
import { handleMmiPortfolio } from '@metamask-institutional/portfolio-dashboard';
import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils';
import { CHAIN_IDS } from '../../../shared/constants/network';
import {
BUILD_QUOTE_ROUTE,
CONNECT_HARDWARE_ROUTE,
} from '../../../ui/helpers/constants/routes';
import { previousValueComparator } from '../lib/util';
import { CONNECT_HARDWARE_ROUTE } from '../../../ui/helpers/constants/routes';
import { getPermissionBackgroundApiMethods } from './permissions';

export default class MMIController extends EventEmitter {
Expand Down Expand Up @@ -63,17 +55,6 @@ export default class MMIController extends EventEmitter {
});
}

this.preferencesController.store.subscribe(
previousValueComparator(async (prevState, currState) => {
const { identities: prevIdentities } = prevState;
const { identities: currIdentities } = currState;
if (isEqual(prevIdentities, currIdentities)) {
return;
}
await this.prepareMmiPortfolio();
}, this.preferencesController.store.getState()),
);

this.signatureController.hub.on(
'personal_sign:signed',
async ({ signature, messageId }) => {
Expand Down Expand Up @@ -584,20 +565,6 @@ export default class MMIController extends EventEmitter {
});
}

async prepareMmiPortfolio() {
if (!process.env.IN_TEST) {
try {
const mmiDashboardData = await this.handleMmiDashboardData();
const cookieSetUrls =
this.mmiConfigurationController.store.mmiConfiguration?.portfolio
?.cookieSetUrls || [];
setDashboardCookie(mmiDashboardData, cookieSetUrls);
} catch (error) {
console.error(error);
}
}
}

async newUnsignedMessage(msgParams, req, version) {
// The code path triggered by deferSetAsSigned: true is for custodial accounts
const accountDetails = this.custodyController.getAccountDetails(
Expand Down Expand Up @@ -673,12 +640,6 @@ export default class MMIController extends EventEmitter {
return true;
}

async handleMmiOpenSwaps(origin, address, chainId) {
await this.setAccountAndNetwork(origin, address, chainId);
this.platform.openExtensionInBrowser(BUILD_QUOTE_ROUTE);
return true;
}

async handleMmiOpenAddHardwareWallet() {
await this.appStateController.getUnlockPromise(true);
this.platform.openExtensionInBrowser(CONNECT_HARDWARE_ROUTE);
Expand Down
16 changes: 16 additions & 0 deletions app/scripts/controllers/preferences.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ export default class PreferencesController {
snapsAddSnapAccountModalDismissed: false,
///: END:ONLY_INCLUDE_IN
isLineaMainnetReleased: false,
///: BEGIN:ONLY_INCLUDE_IN(petnames)
useExternalNameSources: true,
///: END:ONLY_INCLUDE_IN
...opts.initState,
};

Expand Down Expand Up @@ -261,6 +264,19 @@ export default class PreferencesController {
}
///: END:ONLY_INCLUDE_IN

///: BEGIN:ONLY_INCLUDE_IN(petnames)
/**
* Setter for the `useExternalNameSources` property
*
* @param {boolean} useExternalNameSources - Whether or not to use external name providers in the name controller.
*/
setUseExternalNameSources(useExternalNameSources) {
this.store.updateState({
useExternalNameSources,
});
}
///: END:ONLY_INCLUDE_IN

/**
* Setter for the `advancedGasFee` property
*
Expand Down
Loading

0 comments on commit 4aa826b

Please sign in to comment.