This commit is contained in:
Georges KABBOUCHI 2021-08-01 13:40:37 +03:00
parent ac16d2c8b7
commit 52a085ae64
2 changed files with 8 additions and 4 deletions

View File

@ -101,11 +101,16 @@ export function useAaveV2Position(
return newPos;
};
const refreshPosition = async () => {
position.value = await fetchPosition();
};
watch(
web3,
async val => {
if (val) {
position.value = await fetchPosition();
refreshPosition();
}
},
{ immediate: true }
@ -115,7 +120,7 @@ export function useAaveV2Position(
activeAccount,
async val => {
if (val) {
position.value = await fetchPosition();
refreshPosition();
}
},
{ immediate: true }
@ -325,6 +330,7 @@ export function useAaveV2Position(
displayPositions,
position,
fetchPosition,
refreshPosition,
totalSupply,
totalBorrow,
status,

View File

@ -23,8 +23,6 @@ export function useBalances() {
const { getTokenByKey } = useToken();
const fetchBalances = async (refresh = false) => {
await nextTick();
if (!balances.user || refresh) {
balances.user = {
mainnet: await getBalances(account.value, Network.Mainnet, mainnetWeb3),