diff --git a/apps/marginfi-v2-ui/next.config.js b/apps/marginfi-v2-ui/next.config.js index 290776e2bd..0af31da2ea 100644 --- a/apps/marginfi-v2-ui/next.config.js +++ b/apps/marginfi-v2-ui/next.config.js @@ -1,5 +1,7 @@ const withPWA = require('next-pwa')({ - dest: 'public' + dest: 'public', + disable: process.env.NODE_ENV === 'development', + runtimeCaching: "CacheFirst", }) const withBundleAnalyzer = require("@next/bundle-analyzer")({ @@ -110,4 +112,4 @@ config = withSentryConfig( } ); -module.exports = process.env.NODE_ENV === 'development' ? config : withPWA(config); +module.exports = withPWA(config); diff --git a/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/MobileAssetsList.tsx b/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/MobileAssetsList.tsx index 6149adebf4..7e2202fa87 100644 --- a/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/MobileAssetsList.tsx +++ b/apps/marginfi-v2-ui/src/components/mobile/MobileAssetsList/MobileAssetsList.tsx @@ -15,7 +15,7 @@ export const MobileAssetsList: FC = () => { const togglePositions = () => setIsFiltered((previousState) => !previousState); const { connected } = useWalletContext(); - const [isStoreInitialized, sortedBanks, nativeSolBalance, selectedAccount] = useMrgnlendStore((state) => [ + const [isStoreInitialized, extendedBankInfos, nativeSolBalance, selectedAccount] = useMrgnlendStore((state) => [ state.initialized, state.extendedBankInfos, state.nativeSolBalance, @@ -29,6 +29,7 @@ export const MobileAssetsList: FC = () => { if (sortOption.field === "APY") { return sortApRate(banks, isInLendingMode, sortOption.direction); } else if (sortOption.field === "TVL") { + console.log(sortTvl) return sortTvl(banks, sortOption.direction); } else { return banks; @@ -39,26 +40,26 @@ export const MobileAssetsList: FC = () => { const globalBanks = useMemo(() => { const filteredBanks = - sortedBanks && - sortedBanks.filter((b) => !b.info.state.isIsolated).filter((b) => (isFiltered ? b.isActive : true)); + extendedBankInfos && + extendedBankInfos.filter((b) => !b.info.state.isIsolated).filter((b) => (isFiltered ? b.isActive : true)); - if (sortOption && filteredBanks) { + if (isStoreInitialized && sortOption && filteredBanks) { return sortBanks(filteredBanks); } else { return filteredBanks; } - }, [sortedBanks, sortOption, isFiltered, sortBanks]); + }, [isStoreInitialized, extendedBankInfos, sortOption, isFiltered, sortBanks]); const isolatedBanks = useMemo(() => { const filteredBanks = - sortedBanks && sortedBanks.filter((b) => b.info.state.isIsolated).filter((b) => (isFiltered ? b.isActive : true)); + extendedBankInfos && extendedBankInfos.filter((b) => b.info.state.isIsolated).filter((b) => (isFiltered ? b.isActive : true)); - if (sortOption && filteredBanks) { + if (isStoreInitialized && sortOption && filteredBanks) { return sortBanks(filteredBanks); } else { return filteredBanks; } - }, [sortedBanks, sortOption, isFiltered, sortBanks]); + }, [isStoreInitialized, extendedBankInfos, sortOption, isFiltered, sortBanks]); const handleSortChange = (event: SelectChangeEvent) => { setSortOption(SORT_OPTIONS_MAP[event.target.value as SortType]); diff --git a/apps/marginfi-v2-ui/src/components/mobile/WalletSelector.tsx b/apps/marginfi-v2-ui/src/components/mobile/WalletSelector.tsx index 95bdcad10c..5fb0475943 100644 --- a/apps/marginfi-v2-ui/src/components/mobile/WalletSelector.tsx +++ b/apps/marginfi-v2-ui/src/components/mobile/WalletSelector.tsx @@ -11,6 +11,7 @@ import { WalletConnectModal } from "@walletconnect/modal"; const modal = new WalletConnectModal({ projectId: "69125c28c9733812e7b6653a2222cb0e", chains: ["solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ"], + explorerRecommendedWalletIds: ["a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393"] }); const WalletSelector: FC<{ featuredWallets?: number }> = ({ featuredWallets = 3 }) => {