fix bug in disconnect & reconnect
This commit is contained in:
parent
cdd965071d
commit
1629ff5756
|
@ -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 }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
})()
|
})()
|
||||||
|
|
|
@ -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
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue