Skip to content

Commit

Permalink
Smart Cost: higher precision limit via slot click (#17099)
Browse files Browse the repository at this point in the history
  • Loading branch information
naltatis authored Nov 6, 2024
1 parent bb8bf49 commit a95c335
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions assets/js/components/SmartCostLimit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit a95c335

Please sign in to comment.