Smart Cost: higher precision limit via slot click (#17099)

This commit is contained in:
Michael Geers 2024-11-06 15:29:15 +01:00 • committed by GitHub
parent bb8bf49f8d
commit a95c335882
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -288,17 +288,12 @@ export default {
slotHovered(index) {
this.activeIndex = index;
},
setSelectedSmartCostLimit(limit) {
const nextOption = this.costOptions.find(({ value }) => value >= limit);
if (nextOption) {
this.selectedSmartCostLimit = nextOption.value;
}
},
slotSelected(index) {
const price = this.slots[index].price;
if (price !== undefined) {
this.setSelectedSmartCostLimit(price);
this.saveSmartCostLimit(this.selectedSmartCostLimit);
// 3 decimal precision
const priceRounded = Math.ceil(price * 1000) / 1000;
this.saveSmartCostLimit(priceRounded);
}
},
changeSmartCostLimit($event) {