From 4f9bf391519984d358d3cb8298423e2f8f66f9da Mon Sep 17 00:00:00 2001 From: Adam Chambers Date: Thu, 23 Nov 2023 13:58:39 -0500 Subject: [PATCH] feat: mobile account switcher --- apps/marginfi-v2-ui/src/pages/index.tsx | 13 +++++++++++-- .../marginfi-client-v2/src/models/account/pure.ts | 2 -- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/apps/marginfi-v2-ui/src/pages/index.tsx b/apps/marginfi-v2-ui/src/pages/index.tsx index 4e6b552100..cd1878d8c9 100644 --- a/apps/marginfi-v2-ui/src/pages/index.tsx +++ b/apps/marginfi-v2-ui/src/pages/index.tsx @@ -116,6 +116,15 @@ const Home = () => { lend + {walletAddress && selectedAccount && marginfiAccounts.length > 1 && ( + + )}
@@ -165,11 +174,11 @@ const MultipleAccountsBanner = ({ }} > {isRefreshing ? "Loading..." : shortAddress} - + Accounts {marginfiAccounts.map((account, index) => ( - + {account.address.toBase58()} ))} diff --git a/packages/marginfi-client-v2/src/models/account/pure.ts b/packages/marginfi-client-v2/src/models/account/pure.ts index 627c7277a9..8157e2d65b 100644 --- a/packages/marginfi-client-v2/src/models/account/pure.ts +++ b/packages/marginfi-client-v2/src/models/account/pure.ts @@ -295,10 +295,8 @@ class MarginfiAccount { // ------------------------------------- // // collateral bank with positive weights // // ------------------------------------- // - console.log("here"); // bypass volatility factor if no liabilities or if all collateral is untied if (liabilitiesInit.isZero() || initCollateralForBank.lte(freeCollateral)) { - console.log("aqui"); return entireBalance; }