diff --git a/ui/helpers/utils/institutional/find-by-custodian-name.ts b/ui/helpers/utils/institutional/find-by-custodian-name.ts index bdd58d0cbcd2..6e804295dd53 100644 --- a/ui/helpers/utils/institutional/find-by-custodian-name.ts +++ b/ui/helpers/utils/institutional/find-by-custodian-name.ts @@ -24,9 +24,12 @@ export function findCustodianByDisplayName( } for (const custodian of custodians) { - const custodianName = custodian.envName.toLowerCase(); + const custodianName = custodian.name.toLowerCase(); - if (formatedDisplayName.includes(custodianName)) { + if ( + custodianName.length !== 0 && + formatedDisplayName.includes(custodianName) + ) { return custodian; } } diff --git a/ui/pages/institutional/custody/custody.js b/ui/pages/institutional/custody/custody.js index 094d0a5f6016..8343b41ffcdf 100644 --- a/ui/pages/institutional/custody/custody.js +++ b/ui/pages/institutional/custody/custody.js @@ -95,9 +95,11 @@ const CustodyPage = () => { const custodianButtons = useMemo(() => { const custodianItems = []; - const sortedCustodians = [...custodians].sort((a, b) => - a.envName.toLowerCase().localeCompare(b.envName.toLowerCase()), - ); + const sortedCustodians = [...custodians] + .filter((item) => item.type !== 'Jupiter') + .sort((a, b) => + a.envName.toLowerCase().localeCompare(b.envName.toLowerCase()), + ); function shouldShowInProduction(custodian) { return ( diff --git a/ui/pages/institutional/custody/custody.test.js b/ui/pages/institutional/custody/custody.test.js index 800e6a0956d1..fea5460a32f4 100644 --- a/ui/pages/institutional/custody/custody.test.js +++ b/ui/pages/institutional/custody/custody.test.js @@ -43,7 +43,8 @@ describe('CustodyPage', function () { custodians: [ { type: 'GK8', - envName: 'gk8', + envName: 'gk8-prod', + name: 'GK8', apiUrl: 'https://saturn-custody.dev.metamask-institutional.io', iconUrl: 'https://saturn-custody-ui.dev.metamask-institutional.io/saturn.svg', @@ -56,7 +57,8 @@ describe('CustodyPage', function () { }, { type: 'Saturn B', - envName: 'Saturn Custody B', + envName: 'saturn-prod', + name: 'Saturn Custody B', apiUrl: 'https://saturn-custody.dev.metamask-institutional.io', iconUrl: 'https://saturn-custody-ui.dev.metamask-institutional.io/saturn.svg',