From e53c59a3b6868c458b7a62b2af6e73be9501928a Mon Sep 17 00:00:00 2001 From: vjrj <vjrj@comunes.org> Date: Tue, 28 Mar 2023 01:11:08 +0200 Subject: [PATCH] Don't set state when adding to contacts --- .../first_screen/pay_contact_search_page.dart | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/lib/ui/widgets/first_screen/pay_contact_search_page.dart b/lib/ui/widgets/first_screen/pay_contact_search_page.dart index ab48736e..3e5f9d37 100644 --- a/lib/ui/widgets/first_screen/pay_contact_search_page.dart +++ b/lib/ui/widgets/first_screen/pay_contact_search_page.dart @@ -237,16 +237,16 @@ class _PayContactSearchPageState extends State<PayContactSearchPage> { color: isFavorite ? Colors.red.shade400 : null, ), onPressed: () { - setState(() { - if (!isFavorite) { - contactsCubit.addContact(contact); - } else { - contactsCubit.removeContact(Contact( - pubKey: contact.pubKey, - )); - } - }); + // setState(() { + if (!isFavorite) { + contactsCubit.addContact(contact); + } else { + contactsCubit.removeContact(Contact( + pubKey: contact.pubKey, + )); + } }); + // }); }), ); } -- GitLab