Fix: autoclose photo view if photo is delete from everywhere

This commit is contained in:
Neeraj Gupta 2023-01-06 14:09:20 +05:30
parent ac8eb5fdad
commit 579d1248cf
No known key found for this signature in database
GPG key ID: 3C5A1684DC1729E1

View file

@ -379,8 +379,10 @@ class FadingAppBarState extends State<FadingAppBar> {
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<FadingAppBar> {
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);
}
},
),
);