Skip to content

Commit

Permalink
fix: ui: card_reader_page: wait 1s before next poll
Browse files Browse the repository at this point in the history
  • Loading branch information
jjanku committed May 19, 2024
1 parent f8fa3fb commit b448065
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ui/card_reader_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ class _CardReaderPageState extends State<CardReaderPage> {
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();
}
}
Expand Down

0 comments on commit b448065

Please sign in to comment.