Skip to content

Commit

Permalink
fix: 4241 - remove shimmering box if connection fails
Browse files Browse the repository at this point in the history
  • Loading branch information
monsieurtanuki committed Jul 21, 2023
1 parent 6a8b179 commit fd2c338
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,13 @@ class _ProductQuestionsWidgetState extends State<ProductQuestionsWidget>

Future<List<RobotoffQuestion>?> _loadProductQuestions() async {
final LocalDatabase localDatabase = context.read<LocalDatabase>();
final List<RobotoffQuestion> questions =
await ProductQuestionsQuery(widget.product.barcode!)
.getQuestions(localDatabase, 3);
final List<RobotoffQuestion> questions;
try {
questions = await ProductQuestionsQuery(widget.product.barcode!)
.getQuestions(localDatabase, 3);
} catch (e) {
return null;
}
if (!mounted) {
return null;
}
Expand Down

0 comments on commit fd2c338

Please sign in to comment.