Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Fix file download type error

Neeraj Gupta00bdb31670a7
diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
index c1b13c6ea2..5b07d5d44f 100644
--- a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart
@@ -696,7 +696,9 @@ class FileAppBarState extends State<FileAppBar> {
);
} catch (e) {
_logger.warning("Failed to save file", e);
- await showGenericErrorDialog(context: context, error: e);
+ if (mounted) {
+ await showGenericErrorDialog(context: context, error: e);
+ }
}
return;
}
@@ -712,12 +714,18 @@ class FileAppBarState extends State<FileAppBar> {
fileToDownload,
persistToFilesDB: persistToFilesDB,
);
+ if (!mounted) {
+ await dialog.hide();
+ return;
+ }
showToast(context, AppLocalizations.of(context).fileSavedToGallery);
await dialog.hide();
} catch (e) {
_logger.warning("Failed to save file", e);
await dialog.hide();
- await showGenericErrorDialog(context: context, error: e);
+ if (mounted) {
+ await showGenericErrorDialog(context: context, error: e);
+ }
}
}