From ba595b2effb8962414407ca08150719e75ff80d5 Mon Sep 17 00:00:00 2001 From: nick134 <76399455+nick134-bit@users.noreply.github.com> Date: Wed, 15 May 2024 23:11:56 +0200 Subject: [PATCH] fix: disconnect on undefined wallets --- components/Pages/Dashboard/Dashboard.tsx | 1 - components/Wallet/Wallet.tsx | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/Pages/Dashboard/Dashboard.tsx b/components/Pages/Dashboard/Dashboard.tsx index 5006691c..e7416ed0 100644 --- a/components/Pages/Dashboard/Dashboard.tsx +++ b/components/Pages/Dashboard/Dashboard.tsx @@ -24,7 +24,6 @@ export type DashboardData = { } export const Dashboard: FC = () => { const [dashboardState, setDashboardDataState] = useRecoilState(dashboardDataState) - useChain('migaloo') // force wallet connect status const { data: dashboardData, isLoading } = useGetDashboardDataAPI() const chains = useChainInfos() const prices = usePrices() diff --git a/components/Wallet/Wallet.tsx b/components/Wallet/Wallet.tsx index 6869f85f..19532266 100644 --- a/components/Wallet/Wallet.tsx +++ b/components/Wallet/Wallet.tsx @@ -94,6 +94,10 @@ const Wallet = () => { setCurrentConnectedChainIds(snapChainIds) } else if (walletType === WalletType.terraExtension || walletType === WalletType.keplrExtension || walletType === WalletType.galaxyStationExtension) { const walletWindowConnection = walletType === WalletType.terraExtension ? (window.station?.keplr) : walletType === WalletType.galaxyStationExtension ? (window.galaxyStation?.keplr) : (window?.keplr) + if (!walletWindowConnection) { + localStorage.clear() + return + } const getAddedStationChainsIds = async () => { const chainInfos = await walletWindowConnection?.getChainInfosWithoutEndpoints() if (!chainInfos) {