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),
child: GestureDetector(
onTap: () {
previewQuote(quote);
if (_receiveAddressController.text.isNotEmpty &&
_buyAmountController.text.isNotEmpty) {
previewQuote(quote);
}
},
child: PrimaryButton(
buttonHeight: isDesktop ? ButtonHeight.l : null,
enabled: _receiveAddressController.text.isNotEmpty &&
_buyAmountController.text.isNotEmpty,
onPressed: () {
previewQuote(quote);
if (_receiveAddressController.text.isNotEmpty &&
_buyAmountController.text.isNotEmpty) {
previewQuote(quote);
}
},
label: "Preview quote",
)),