[mob][photos] Fix infinite loading on searching (#1830)

## Description

Search was infinitely loading even after all search results are ready.
This commit is contained in:
Ashil 2024-05-23 18:59:36 +05:30 committed by GitHub
parent 31dee1249d
commit 30a8691c7f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -203,7 +203,7 @@ class SearchWidgetState extends State<SearchWidget> {
String query,
) {
int resultCount = 0;
final maxResultCount = _isYearValid(query) ? 13 : 12;
final maxResultCount = _isYearValid(query) ? 12 : 11;
final streamController = StreamController<List<SearchResult>>();
if (query.isEmpty) {
@ -260,10 +260,11 @@ class SearchWidgetState extends State<SearchWidget> {
onResultsReceived(locationResult);
},
);
_searchService.getAllFace(null).then(
(locationResult) {
(faceResult) {
final List<GenericSearchResult> filteredResults = [];
for (final result in locationResult) {
for (final result in faceResult) {
if (result.name().toLowerCase().contains(query.toLowerCase())) {
filteredResults.add(result);
}