Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Show error on UI in debugMode

laurenspriemb45dfa9cfc58
diff --git a/mobile/lib/ui/viewer/people/add_person_action_sheet.dart b/mobile/lib/ui/viewer/people/add_person_action_sheet.dart
index a0f9f76a70..83a19ac316 100644
--- a/mobile/lib/ui/viewer/people/add_person_action_sheet.dart
+++ b/mobile/lib/ui/viewer/people/add_person_action_sheet.dart
@@ -188,7 +188,16 @@ class _PersonActionSheetState extends State<PersonActionSheet> {
if (snapshot.hasError) {
log("Error: ${snapshot.error} ${snapshot.stackTrace}}");
//Need to show an error on the UI here
- return const SizedBox.shrink();
+ if (kDebugMode) {
+ return Column(
+ children: [
+ Text('${snapshot.error}'),
+ Text('${snapshot.stackTrace}'),
+ ],
+ );
+ } else {
+ return const SizedBox.shrink();
+ }
} else if (snapshot.hasData) {
final persons = snapshot.data!;
final searchResults = _searchQuery.isNotEmpty
@@ -320,7 +329,8 @@ class _PersonActionSheetState extends State<PersonActionSheet> {
final files = clustersToFiles.values.expand((e) => e).toList();
if (files.isEmpty) {
debugPrint(
- "Person ${kDebugMode ? person.data.name : person.remoteID} has no files");
+ "Person ${kDebugMode ? person.data.name : person.remoteID} has no files",
+ );
continue;
}
personAndFileID.add((person, files.first));