prevent quote preview if required inputs empty

it should be prevented by the enabled property but nyah
This commit is contained in:
sneurlax 2023-01-20 20:09:42 -06:00
parent 1bf55318cc
commit 46e1d41126

View file

@ -1088,14 +1088,20 @@ class _BuyFormState extends ConsumerState<BuyForm> {
onExit: (_) => setState(() => _hovering1 = false), onExit: (_) => setState(() => _hovering1 = false),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
previewQuote(quote); if (_receiveAddressController.text.isNotEmpty &&
_buyAmountController.text.isNotEmpty) {
previewQuote(quote);
}
}, },
child: PrimaryButton( child: PrimaryButton(
buttonHeight: isDesktop ? ButtonHeight.l : null, buttonHeight: isDesktop ? ButtonHeight.l : null,
enabled: _receiveAddressController.text.isNotEmpty && enabled: _receiveAddressController.text.isNotEmpty &&
_buyAmountController.text.isNotEmpty, _buyAmountController.text.isNotEmpty,
onPressed: () { onPressed: () {
previewQuote(quote); if (_receiveAddressController.text.isNotEmpty &&
_buyAmountController.text.isNotEmpty) {
previewQuote(quote);
}
}, },
label: "Preview quote", label: "Preview quote",
)), )),