fix price overwrite
This commit is contained in:
parent
370a5329a9
commit
689fa13a7e
1 changed files with 6 additions and 3 deletions
|
@ -99,10 +99,13 @@ class _SupplyPageState extends State<SupplyPage> {
|
|||
});
|
||||
},
|
||||
onSelected: (String selection) async {
|
||||
var price =
|
||||
await API().getLatestPrice(widget.item.id, variant);
|
||||
var price = _price.isEmpty
|
||||
? await API()
|
||||
.getLatestPrice(widget.item.id, variant)
|
||||
.then((x) => x.value.toStringAsFixed(2))
|
||||
: _price;
|
||||
setState(() {
|
||||
_price = price.value.toStringAsFixed(2);
|
||||
_price = price;
|
||||
_selectedOrigin = selection;
|
||||
});
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue