Asset view touchup; withdrawal of zero disallowed
This commit is contained in:
@@ -36,7 +36,7 @@ const props = defineProps(['modelValue', 'vault', 'token'])
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
const balance = computed(() => {
|
||||
console.log('balance', props.vault, props.token, s.vaultBalances)
|
||||
return s.vaultBalances[props.vault][props.token.address] || 0
|
||||
return BigInt(s.vaultBalances[props.vault][props.token.address]) || 0n
|
||||
})
|
||||
const balanceFloat = computed(() => tokenFloat(props.token, balance.value))
|
||||
const floatAmount = ref(0)
|
||||
@@ -46,9 +46,9 @@ function withdraw() {
|
||||
const valueStr = floatAmount.value.toString();
|
||||
const amount = floatAmount.value === balanceFloat.value ? balance.value :
|
||||
FixedNumber.fromString(valueStr,{decimals:props.token.d, width:256, signed: false}).value;
|
||||
console.log('pending withdrawal', valueStr, amount, props.token.s)
|
||||
if( amount === 0n )
|
||||
return
|
||||
console.log('pending withdrawal', valueStr, amount, props.token.s)
|
||||
pendTransaction(async (signer)=>{
|
||||
const vault = await vaultContract(vaultAddr, signer)
|
||||
return await vault['withdraw(address,uint256)'](props.token.a, amount)
|
||||
|
||||
Reference in New Issue
Block a user