From 579d1248cf7b743222d4ce8c0083bf94b83c78c0 Mon Sep 17 00:00:00 2001 From: Neeraj Gupta <254676+ua741@users.noreply.github.com> Date: Fri, 6 Jan 2023 14:09:20 +0530 Subject: [PATCH] Fix: autoclose photo view if photo is delete from everywhere --- lib/ui/viewer/file/fading_app_bar.dart | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/ui/viewer/file/fading_app_bar.dart b/lib/ui/viewer/file/fading_app_bar.dart index 6fffcec64..39805ed5a 100644 --- a/lib/ui/viewer/file/fading_app_bar.dart +++ b/lib/ui/viewer/file/fading_app_bar.dart @@ -379,8 +379,10 @@ class FadingAppBarState extends State { onTap: () async { await deleteFilesFromRemoteOnly(context, [file]); showShortToast(context, "Moved to trash"); - // Navigator.of(context, rootNavigator: true).pop(); - // TODO: Fix behavior when inside a collection + if (isRemoteOnly) { + Navigator.of(context, rootNavigator: true).pop(); + widget.onFileRemoved(file); + } }, ), ); @@ -399,9 +401,10 @@ class FadingAppBarState extends State { isInAlert: true, onTap: () async { await deleteFilesOnDeviceOnly(context, [file]); - // showShortToast(context, "File deleted from device"); - // Navigator.of(context, rootNavigator: true).pop(); - // TODO: Fix behavior when inside a device folder + if (isLocalOnly) { + Navigator.of(context, rootNavigator: true).pop(); + widget.onFileRemoved(file); + } }, ), );