mirror of
https://github.com/RoboSats/robosats.git
synced 2025-01-18 20:21:35 +00:00
Update handleCurrencyChange to not reset amount range on currency change in maker form (#692)
* Update handleCurrencyChange to not reset amount range on currency change * Update MakerForm.tsx
This commit is contained in:
parent
d13af1a1b1
commit
c26e2f919a
@ -140,11 +140,17 @@ const MakerForm = ({
|
||||
updateCurrentPrice(limits.list, newCurrency, maker.premium);
|
||||
|
||||
if (makerHasAmountRange) {
|
||||
setMaker({
|
||||
...maker,
|
||||
minAmount: parseFloat(Number(limits.list[newCurrency].max_amount * 0.25).toPrecision(2)),
|
||||
maxAmount: parseFloat(Number(limits.list[newCurrency].max_amount * 0.75).toPrecision(2)),
|
||||
});
|
||||
const minAmount = parseFloat(Number(limits.list[newCurrency].min_amount).toPrecision(2));
|
||||
const maxAmount = parseFloat(Number(limits.list[newCurrency].max_amount).toPrecision(2));
|
||||
if (parseFloat(maker.minAmount) < minAmount || parseFloat(maker.minAmount) > maxAmount
|
||||
|| parseFloat(maker.maxAmount) > maxAmount || parseFloat(maker.maxAmount) < minAmount)
|
||||
{
|
||||
setMaker({
|
||||
...maker,
|
||||
minAmount: (maxAmount * 0.25).toPrecision(2),
|
||||
maxAmount: (maxAmount * 0.75).toPrecision(2),
|
||||
});
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user