From b448065e688ad0c2469a871865ef6bc12faa0c3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Jank=C5=AF?= Date: Sun, 19 May 2024 22:24:01 +0200 Subject: [PATCH] fix: ui: card_reader_page: wait 1s before next poll --- lib/ui/card_reader_page.dart | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ui/card_reader_page.dart b/lib/ui/card_reader_page.dart index 199059f..274c144 100644 --- a/lib/ui/card_reader_page.dart +++ b/lib/ui/card_reader_page.dart @@ -91,9 +91,11 @@ class _CardReaderPageState extends State { setStatus(ReaderOkStatus.waiting); } } catch (e) { - /* FIXME: make sure not to end up in a busy loop */ if (!mounted) return; _showError(); + /* TODO: request a retry from the user instead? */ + await Future.delayed(const Duration(seconds: 1)); + if (!mounted) return; _poll(); } }