order amount bugfix

This commit is contained in:
Tim Olson
2023-11-27 18:35:40 -04:00
parent 1dff2da3fe
commit e25239d81f
4 changed files with 17 additions and 16 deletions

View File

@@ -150,6 +150,8 @@ export const useOrderStore = defineStore('order', ()=> {
const limitIsMinimum = computed(() => !(buy.value ^ inverted.value))
const amountToken = computed(() => amountIsTokenA.value ? tokenA.value : tokenB.value)
const amountIsInput = computed(() => amountIsTokenA.value !== buy.value)
const totalAmount = computed(()=> amountIsTotal.value ? amount.value : amount.value * tranches.value )
const trancheAmount = computed(()=> amountIsTotal.value ? amount.value / tranches.value : amount.value )
function setDefaultTokens(tokens) {
if( tokens.length > 0 )
@@ -161,6 +163,6 @@ export const useOrderStore = defineStore('order', ()=> {
return {
tokenA, tokenB, buy, inverted, amount, amountIsTokenA, amountIsTotal, limitPrice, limitPrice2, tranches,
interval, intervalIsTotal, timeUnitIndex, routes, routesPending, validOrder, route, base, quote, pairSymbol,
limitIsMinimum, amountToken, amountIsInput, setDefaultTokens,
limitIsMinimum, amountToken, amountIsInput, setDefaultTokens, totalAmount, trancheAmount,
}
})