From 1e244b94473a92e44b2230824a89cf4647b6d6b9 Mon Sep 17 00:00:00 2001 From: Adam Chambers Date: Fri, 24 Nov 2023 20:06:04 -0500 Subject: [PATCH] chore: remove debugs --- .../DesktopAccountSummary.tsx | 11 ++++++----- apps/marginfi-v2-ui/src/pages/index.tsx | 16 ++++++++++------ .../src/models/account/pure.ts | 4 ---- .../marginfi-v2-ui-state/src/lib/firebase.ts | 1 - 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/apps/marginfi-v2-ui/src/components/desktop/DesktopAccountSummary/DesktopAccountSummary.tsx b/apps/marginfi-v2-ui/src/components/desktop/DesktopAccountSummary/DesktopAccountSummary.tsx index 09437627b3..9833d0b64d 100644 --- a/apps/marginfi-v2-ui/src/components/desktop/DesktopAccountSummary/DesktopAccountSummary.tsx +++ b/apps/marginfi-v2-ui/src/components/desktop/DesktopAccountSummary/DesktopAccountSummary.tsx @@ -1,15 +1,18 @@ -import React, { FC } from "react"; +import React from "react"; + import dynamic from "next/dynamic"; import { useMrgnlendStore } from "~/store"; +import { cn } from "~/utils"; import { useWalletContext } from "~/hooks/useWalletContext"; + import { UserStats } from "~/components/common/AccountSummary"; const GlobalStats = dynamic(async () => (await import("~/components/common/AccountSummary/GlobalStats")).GlobalStats, { ssr: false, }); -const AccountSummary: FC = () => { +const AccountSummary = () => { const [isStoreInitialized, accountSummary, protocolStats, selectedAccount] = useMrgnlendStore((state) => [ state.initialized, state.accountSummary, @@ -18,10 +21,8 @@ const AccountSummary: FC = () => { ]); const { connected } = useWalletContext(); - // console.log(isStoreInitialized, accountSummary, protocolStats, selectedAccount); - return ( -
+
Global stats diff --git a/apps/marginfi-v2-ui/src/pages/index.tsx b/apps/marginfi-v2-ui/src/pages/index.tsx index 7b4fb20b66..fd88bd2c31 100644 --- a/apps/marginfi-v2-ui/src/pages/index.tsx +++ b/apps/marginfi-v2-ui/src/pages/index.tsx @@ -34,18 +34,22 @@ const Home = () => { const { walletAddress, wallet, isOverride } = useWalletContext(); const { connection } = useConnection(); const debounceId = React.useRef(null); - const [fetchMrgnlendState, setIsRefreshingStore, marginfiAccounts, selectedAccount] = useMrgnlendStore((state) => [ + const [ + fetchMrgnlendState, + isStoreInitialized, + isRefreshingStore, + setIsRefreshingStore, + marginfiAccounts, + selectedAccount, + ] = useMrgnlendStore((state) => [ state.fetchMrgnlendState, + state.initialized, + state.isRefreshingStore, state.setIsRefreshingStore, state.marginfiAccounts, state.selectedAccount, ]); - const [isStoreInitialized, isRefreshingStore] = useMrgnlendStore((state) => [ - state.initialized, - state.isRefreshingStore, - ]); - React.useEffect(() => { const fetchData = () => { setIsRefreshingStore(true); diff --git a/packages/marginfi-client-v2/src/models/account/pure.ts b/packages/marginfi-client-v2/src/models/account/pure.ts index 8157e2d65b..dd0d41566f 100644 --- a/packages/marginfi-client-v2/src/models/account/pure.ts +++ b/packages/marginfi-client-v2/src/models/account/pure.ts @@ -302,13 +302,9 @@ class MarginfiAccount { // apply volatility factor to avoid failure due to price volatility / slippage const initUntiedCollateralForBank = freeCollateral.times(_volatilityFactor); - console.log("initUntiedCollateralForBank", initUntiedCollateralForBank.toFixed(6)); const priceLowestBias = bank.getPrice(priceInfo, PriceBias.Lowest); - console.log("priceLowestBias", priceLowestBias.toFixed(6)); const initWeightedPrice = priceLowestBias.times(initAssetWeight); - console.log("initWeightedPrice", initWeightedPrice.toFixed(6)); const maxWithdraw = initUntiedCollateralForBank.div(initWeightedPrice); - console.log("maxWithdraw", maxWithdraw.toFixed(6)); return maxWithdraw; } diff --git a/packages/marginfi-v2-ui-state/src/lib/firebase.ts b/packages/marginfi-v2-ui-state/src/lib/firebase.ts index 644a2b1f9d..d806dcaf9e 100644 --- a/packages/marginfi-v2-ui-state/src/lib/firebase.ts +++ b/packages/marginfi-v2-ui-state/src/lib/firebase.ts @@ -284,7 +284,6 @@ async function signLoginTx( async function signinFirebaseAuth(token: string) { try { await signInWithCustomToken(auth, token); - console.log("Signed user in."); } catch (error: any) { console.error("Error signing in with custom token: ", error); if (error.code === "auth/network-request-failed") {