From 8fd62127f8103840809d4586756fdbf4ea01f924 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Thu, 5 Jan 2023 09:48:17 +0530 Subject: [PATCH] Disabled asset change notifying only after getFile() is done on downloading a file --- lib/ui/viewer/file/fading_app_bar.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ui/viewer/file/fading_app_bar.dart b/lib/ui/viewer/file/fading_app_bar.dart index 9e64aa883..54df8ba9f 100644 --- a/lib/ui/viewer/file/fading_app_bar.dart +++ b/lib/ui/viewer/file/fading_app_bar.dart @@ -411,15 +411,15 @@ class FadingAppBarState extends State { Future _download(File file) async { final dialog = createProgressDialog(context, "Downloading..."); await dialog.show(); - //Disabling notifications for assets changing to insert the file into - //files db before triggering a sync. - PhotoManager.stopChangeNotify(); try { final FileType type = file.fileType; final bool downloadLivePhotoOnDroid = type == FileType.livePhoto && Platform.isAndroid; AssetEntity? savedAsset; final io.File? fileToSave = await getFile(file); + //Disabling notifications for assets changing to insert the file into + //files db before triggering a sync. + PhotoManager.stopChangeNotify(); if (type == FileType.image) { savedAsset = await PhotoManager.editor .saveImageWithPath(fileToSave!.path, title: file.title!);