diff --git a/lib/data/models/payment_cubit.dart b/lib/data/models/payment_cubit.dart index 71d7be532cf8a5b04b44bfa8c3b032cb7f2b1f16..5b3b1efd0e839ed9360090c28bc703ad37549296 100644 --- a/lib/data/models/payment_cubit.dart +++ b/lib/data/models/payment_cubit.dart @@ -53,4 +53,8 @@ class PaymentCubit extends HydratedCubit<PaymentState> { void selectAmount(double amount) { emit(state.copyWith(amount: amount)); } + + void setDescription(String description) { + emit(state.copyWith(description: description)); + } } diff --git a/lib/g1/api.dart b/lib/g1/api.dart index a2e3ac90f2ac7d2d67810652853c13cce29d74d9..c9322a5350383af91eea8adce352a0354b976808 100644 --- a/lib/g1/api.dart +++ b/lib/g1/api.dart @@ -427,10 +427,14 @@ Future<String> pay( final List<Node> nodes = nodesWorkingList(NodeType.gva); // reorder list to use others if (nodes.isNotEmpty) { - nodes.shuffle(); + // nodes.shuffle(); + // no hay Retry? try { - final Gva gva = Gva(node: nodes.first.url); + final String node = nodes.first.url; + final Gva gva = Gva(node: node); final CesiumWallet wallet = await SharedPreferencesHelper().getWallet(); + print( + 'Trying to send $amount to $to with comment ${comment ?? ''} and $node'); final String response = await gva.pay( recipient: to, amount: amount, diff --git a/lib/ui/screens/pay_form.dart b/lib/ui/screens/pay_form.dart index 20f3d42edb6093aa32f2e6867571cd339a5604d7..5b4e13a5f4f2e921e5957ecb0a8bc25cb8e39ad3 100644 --- a/lib/ui/screens/pay_form.dart +++ b/lib/ui/screens/pay_form.dart @@ -35,6 +35,11 @@ class _PayFormState extends State<PayForm> { const SizedBox(height: 10.0), TextField( controller: _commentController, + onChanged: (String? value) { + if (value != null) { + context.read<PaymentCubit>().setDescription(value); + } + }, decoration: InputDecoration( labelText: tr('g1_form_pay_desc'), hintText: tr('g1_form_pay_hint'),