Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mobile][photos] remove duplicated error dialogs on failed delete operations

Priyanshu Dangare96cad8a86869
diff --git a/mobile/apps/photos/lib/ui/tools/similar_images_page.dart b/mobile/apps/photos/lib/ui/tools/similar_images_page.dart
index d0401da022..ae215a3f2b 100644
--- a/mobile/apps/photos/lib/ui/tools/similar_images_page.dart
+++ b/mobile/apps/photos/lib/ui/tools/similar_images_page.dart
@@ -978,19 +978,24 @@ class _SimilarImagesPageState extends State<SimilarImagesPage>
);
} catch (e, s) {
_logger.severe("Failed to delete files", e, s);
- if (flagService.internalUser) {
- await showGenericErrorDialog(context: context, error: e);
- }
+ await showGenericErrorDialog(context: context, error: e);
}
},
);
} else {
- await _deleteFilesLogic(
- filesToDelete,
- true,
- showUIFeedback: showUIFeedback,
- maintainScrollAnchor: maintainScrollAnchor,
- );
+ try {
+ await _deleteFilesLogic(
+ filesToDelete,
+ true,
+ showUIFeedback: showUIFeedback,
+ maintainScrollAnchor: maintainScrollAnchor,
+ );
+ } catch (e, s) {
+ _logger.severe("Failed to delete files", e, s);
+ if (mounted) {
+ await showGenericErrorDialog(context: context, error: e);
+ }
+ }
}
}
diff --git a/mobile/apps/photos/lib/utils/delete_file_util.dart b/mobile/apps/photos/lib/utils/delete_file_util.dart
index b297a4ba4f..f9703efc65 100644
--- a/mobile/apps/photos/lib/utils/delete_file_util.dart
+++ b/mobile/apps/photos/lib/utils/delete_file_util.dart
@@ -106,7 +106,6 @@ Future<void> deleteFilesFromEverywhere(
await FilesDB.instance.deleteMultipleUploadedFiles(fileIDs);
} catch (e) {
_logger.severe(e);
- await showGenericErrorDialog(context: context, error: e);
rethrow;
}
for (final collectionID in updatedCollectionIDs) {
@@ -169,7 +168,6 @@ Future<void> deleteFilesFromRemoteOnly(
await FilesDB.instance.deleteMultipleUploadedFiles(uploadedFileIDs);
} catch (e, s) {
_logger.severe("Failed to delete files from remote", e, s);
- await showGenericErrorDialog(context: context, error: e);
rethrow;
}
for (final collectionID in updatedCollectionIDs) {