From 1314d55b897aa0109f1c0a946c835f6aa1208ae2 Mon Sep 17 00:00:00 2001 From: Antonio Regadas Date: Fri, 22 Sep 2023 12:06:47 +0100 Subject: [PATCH 1/2] prettier --- ui/helpers/utils/institutional/find-by-custodian-name.ts | 7 +++++-- ui/pages/institutional/custody/custody.js | 8 +++++--- 2 files changed, 10 insertions(+), 5 deletions(-) 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 ( From 0aa10013e5571b56f46af2f8f206e3ae86d1bef7 Mon Sep 17 00:00:00 2001 From: Antonio Regadas Date: Fri, 22 Sep 2023 12:21:10 +0100 Subject: [PATCH 2/2] fix test --- ui/pages/institutional/custody/custody.test.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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',