mirror of
https://github.com/Instadapp/assembly.git
synced 2024-07-29 22:37:06 +00:00
wip
This commit is contained in:
parent
ac16d2c8b7
commit
52a085ae64
|
@ -101,11 +101,16 @@ export function useAaveV2Position(
|
||||||
return newPos;
|
return newPos;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const refreshPosition = async () => {
|
||||||
|
position.value = await fetchPosition();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
web3,
|
web3,
|
||||||
async val => {
|
async val => {
|
||||||
if (val) {
|
if (val) {
|
||||||
position.value = await fetchPosition();
|
refreshPosition();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
|
@ -115,7 +120,7 @@ export function useAaveV2Position(
|
||||||
activeAccount,
|
activeAccount,
|
||||||
async val => {
|
async val => {
|
||||||
if (val) {
|
if (val) {
|
||||||
position.value = await fetchPosition();
|
refreshPosition();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
|
@ -325,6 +330,7 @@ export function useAaveV2Position(
|
||||||
displayPositions,
|
displayPositions,
|
||||||
position,
|
position,
|
||||||
fetchPosition,
|
fetchPosition,
|
||||||
|
refreshPosition,
|
||||||
totalSupply,
|
totalSupply,
|
||||||
totalBorrow,
|
totalBorrow,
|
||||||
status,
|
status,
|
||||||
|
|
|
@ -23,8 +23,6 @@ export function useBalances() {
|
||||||
const { getTokenByKey } = useToken();
|
const { getTokenByKey } = useToken();
|
||||||
|
|
||||||
const fetchBalances = async (refresh = false) => {
|
const fetchBalances = async (refresh = false) => {
|
||||||
await nextTick();
|
|
||||||
|
|
||||||
if (!balances.user || refresh) {
|
if (!balances.user || refresh) {
|
||||||
balances.user = {
|
balances.user = {
|
||||||
mainnet: await getBalances(account.value, Network.Mainnet, mainnetWeb3),
|
mainnet: await getBalances(account.value, Network.Mainnet, mainnetWeb3),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user