fix bug in disconnect & reconnect

This commit is contained in:
Maximilian Schneider 2021-07-05 17:27:47 +02:00
parent cdd965071d
commit 1629ff5756
3 changed files with 1 additions and 11 deletions

View File

@ -18,13 +18,6 @@ export function findLargestBalanceAccountForMint(
const account = accounts[maxBalanceAccountIndex] const account = accounts[maxBalanceAccountIndex]
const balance = balances[maxBalanceAccountIndex] const balance = balances[maxBalanceAccountIndex]
console.log(
'findLargestBalanceAccountForMint',
maxBalanceAccountIndex,
account,
balance
)
return { account, balance } return { account, balance }
} }

View File

@ -109,7 +109,6 @@ export default function useWallet() {
setWalletStore((state) => { setWalletStore((state) => {
state.connected = false state.connected = false
state.tokenAccounts = [] state.tokenAccounts = []
state.mints = {}
}) })
notify({ notify({
type: 'info', type: 'info',
@ -128,7 +127,7 @@ export default function useWallet() {
// fetch pool on page load // fetch pool on page load
useEffect(() => { useEffect(() => {
(async () => { ;(async () => {
await actions.fetchPool() await actions.fetchPool()
actions.fetchMints() actions.fetchMints()
})() })()

View File

@ -152,8 +152,6 @@ const useWalletStore = create<WalletStore>((set, get) => ({
walletOwner walletOwner
) )
console.log('fetchWalletTokenAccounts', ownedTokenAccounts)
set((state) => { set((state) => {
state.tokenAccounts = ownedTokenAccounts state.tokenAccounts = ownedTokenAccounts
}) })