Skip to content

armgit / ente

Public Imported from GitHub
0

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

Cleanup captures only after successful add to album

laurenspriemf10d2514450b
diff --git a/mobile/apps/photos/lib/ui/activity/ritual_camera_page.dart b/mobile/apps/photos/lib/ui/activity/ritual_camera_page.dart
index 016e7b3168..2070d805be 100644
--- a/mobile/apps/photos/lib/ui/activity/ritual_camera_page.dart
+++ b/mobile/apps/photos/lib/ui/activity/ritual_camera_page.dart
@@ -267,6 +267,7 @@ class _RitualCameraPageState extends State<RitualCameraPage>
return;
}
final List<XFile> pending = List<XFile>.from(_captures);
+ bool saved = false;
setState(() {
_saving = true;
});
@@ -286,6 +287,7 @@ class _RitualCameraPageState extends State<RitualCameraPage>
true,
sharedFiles: shared,
);
+ saved = true;
if (!mounted) return;
showShortToast(
context,
@@ -316,13 +318,17 @@ class _RitualCameraPageState extends State<RitualCameraPage>
);
}
} finally {
- _cleanupCaptures(pending);
if (mounted) {
setState(() {
_saving = false;
- _captures = <XFile>[];
+ if (saved) {
+ _captures = <XFile>[];
+ }
});
}
+ if (saved) {
+ _cleanupCaptures(pending);
+ }
}
}