Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Fallback to using first file as thumbnail for contacts section elements if PersonFaceWidget fails in contact section

ashilknc96102c2b80a
diff --git a/mobile/lib/ui/viewer/search/result/search_thumbnail_widget.dart b/mobile/lib/ui/viewer/search/result/search_thumbnail_widget.dart
index 894beab436..6126f4d762 100644
--- a/mobile/lib/ui/viewer/search/result/search_thumbnail_widget.dart
+++ b/mobile/lib/ui/viewer/search/result/search_thumbnail_widget.dart
@@ -108,6 +108,13 @@ class _ContactSearchThumbnailWidgetState
return PersonFaceWidget(
snapshot.data!,
personId: _personID,
+ onErrorCallback: () {
+ if (mounted) {
+ setState(() {
+ _mostRecentFileOfPerson = null;
+ });
+ }
+ },
);
} else if (snapshot.connectionState == ConnectionState.done &&
snapshot.data == null) {
diff --git a/mobile/lib/ui/viewer/search_tab/contacts_section.dart b/mobile/lib/ui/viewer/search_tab/contacts_section.dart
index 02dd2193a9..72eca2ac89 100644
--- a/mobile/lib/ui/viewer/search_tab/contacts_section.dart
+++ b/mobile/lib/ui/viewer/search_tab/contacts_section.dart
@@ -213,6 +213,13 @@ class _ContactRecommendationState extends State<ContactRecommendation> {
return PersonFaceWidget(
snapshot.data!,
personId: _personID,
+ onErrorCallback: () {
+ if (mounted) {
+ setState(() {
+ _mostRecentFileOfPerson = null;
+ });
+ }
+ },
);
} else if (snapshot.connectionState ==
ConnectionState.done &&