fix image not exported correctly if not stored
Some checks are pending
Flutter analyze & test / flutter_analyze_and_test (push) Waiting to run

This commit is contained in:
otsmr 2026-08-22 23:26:51 +02:00
parent 4b11031560
commit c13b80990f

View file

@ -207,6 +207,19 @@ class _SynchronizedImageViewerScreenState
Future<void> _exportFile() async { Future<void> _exportFile() async {
final item = widget.galleryItems[_currentIndex].mediaService; final item = widget.galleryItems[_currentIndex].mediaService;
if (!item.storedPath.existsSync()) {
await item.storeMediaFile();
if (!mounted) return;
if (userService.currentUser.storeMediaFilesInGallery) {
showSnackbar(
context,
context.lang.galleryExportSuccess,
level: SnackbarLevel.success,
);
return;
}
}
try { try {
if (item.mediaFile.type == MediaType.video) { if (item.mediaFile.type == MediaType.video) {
await saveVideoToGallery( await saveVideoToGallery(