This commit is contained in:
Martin Quarda 2024-10-14 15:16:16 +02:00
parent a537334fba
commit 3481fed915

View File

@ -211,7 +211,10 @@ class Main extends Component {
})
}else{
this.setState({
cart: [...this.state.cart, {"name": "Doprava na " + point.name, "id": 2, "price": delivery_cost, "locked": true, "quantity": 1}],
cart: [
...this.state.cart.filter(product => !product.name.startsWith("Doprava na ")),
{"name": "Doprava na " + point.name, "id": 2, "price": delivery_cost, "locked": true, "quantity": 1}
],
delivery: point.name,
status_text: json.reason,
status: "success",