Skip to content

Commit

Permalink
Update pkgs/cupertino_http/example/lib/main.dart
Browse files Browse the repository at this point in the history
Co-authored-by: Nate Bosch <[email protected]>
  • Loading branch information
brianquinlan and natebosch authored Nov 6, 2023
1 parent b682c9b commit 7a7bff6
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions pkgs/cupertino_http/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,12 @@ class _HomePageState extends State<HomePage> {
}

final books = await _findMatchingBooks(query);
if (query == _lastQuery) {
// Avoid the situation where a slow-running query finishes late and
// replaces newer search results.
setState(() {
_books = books;
});
}
// Avoid the situation where a slow-running query finishes late and
// replaces newer search results.
if (query == _lastQuery) return;
setState(() {
_books = books;
});
}

@override
Expand Down

0 comments on commit 7a7bff6

Please sign in to comment.