diff --git a/src/App.tsx b/src/App.tsx index 06a2181..7c96f54 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -8,7 +8,6 @@ import { Routes, Route, useLocation, Navigate } from 'react-router-dom' import { updateUser } from 'store/profile' import { updateUserTransactions } from 'store/userTransactions' import NotificationPopup from 'components/NotificationPopup' -import { switchLedgerType } from 'ledgers/utils' import { connectUser } from './utils/projectUtils' import { useApollo } from './graphql/client' import Layout from './components/Layout' @@ -35,30 +34,11 @@ const App = () => { const themeColor = useSelector((state: RootState) => state.settings.theme) const newApolloClient = useApollo(null) const isMainnet = CHAIN_DETAILS.CHAIN_ID === 'cudos-1' - - const { - lastLoggedAddress, - connectedLedger, - loadingState - } = useSelector((state: RootState) => state.profile) - + const state = useSelector((state: RootState) => state.userTransactions) const dispatch = useDispatch() const connectAccount = useCallback(async (walletName: SUPPORTED_WALLET) => { try { - - const { address } = await switchLedgerType(walletName) - if (address !== lastLoggedAddress || lastLoggedAddress === '') { - dispatch( - updateUserTransactions({ - offsetCount: 0, - data: [], - hasActivity: false, - loading: true - }) - ) - } - const connectedUser = await connectUser(walletName) dispatch(updateUser(connectedUser)) @@ -112,8 +92,8 @@ const App = () => { )} {location.pathname === '/' ? null : ( - {loadingState ? : null} - + {state.loading ? : null} + }> diff --git a/src/components/Dialog/components/Loading.tsx b/src/components/Dialog/components/Loading.tsx index 66648b3..2b2095b 100644 --- a/src/components/Dialog/components/Loading.tsx +++ b/src/components/Dialog/components/Loading.tsx @@ -1,7 +1,12 @@ import { CircularProgress, Typography } from '@mui/material' import { ModalContainer } from './styles' +import { useSelector } from 'react-redux' +import { RootState } from 'store' const Loading: React.FC = () => { + + const { connectedLedger } = useSelector((state: RootState) => state.profile) + return ( @@ -9,7 +14,7 @@ const Loading: React.FC = () => { Processing... - Check details in your Keplr Wallet + {`Check details in your ${connectedLedger} Wallet`} )