Skip to content

Commit a95c335

Browse files
authored
Smart Cost: higher precision limit via slot click (#17099)
1 parent bb8bf49 commit a95c335

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

assets/js/components/SmartCostLimit.vue

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -288,17 +288,12 @@ export default {
288288
slotHovered(index) {
289289
this.activeIndex = index;
290290
},
291-
setSelectedSmartCostLimit(limit) {
292-
const nextOption = this.costOptions.find(({ value }) => value >= limit);
293-
if (nextOption) {
294-
this.selectedSmartCostLimit = nextOption.value;
295-
}
296-
},
297291
slotSelected(index) {
298292
const price = this.slots[index].price;
299293
if (price !== undefined) {
300-
this.setSelectedSmartCostLimit(price);
301-
this.saveSmartCostLimit(this.selectedSmartCostLimit);
294+
// 3 decimal precision
295+
const priceRounded = Math.ceil(price * 1000) / 1000;
296+
this.saveSmartCostLimit(priceRounded);
302297
}
303298
},
304299
changeSmartCostLimit($event) {

0 commit comments

Comments
 (0)