浏览代码

Fix: autoclose photo view if photo is delete from everywhere

Neeraj Gupta 2 年之前
父节点
当前提交
579d1248cf
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8 5
      lib/ui/viewer/file/fading_app_bar.dart

+ 8 - 5
lib/ui/viewer/file/fading_app_bar.dart

@@ -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);
+            }
           },
         ),
       );