From d157c16933fb2ada43b5718303f20cf62dfe6bc4 Mon Sep 17 00:00:00 2001 From: Christopher Ng Date: Tue, 5 Dec 2023 14:45:20 -0800 Subject: [PATCH] fix: Disable view file in trashbin Signed-off-by: Christopher Ng (cherry picked from commit d3dfb790206e2c2fd9c2df234be9a6a308cac7d0) --- src/views/Viewer.vue | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/views/Viewer.vue b/src/views/Viewer.vue index c76fd0838..237fbce75 100644 --- a/src/views/Viewer.vue +++ b/src/views/Viewer.vue @@ -927,6 +927,10 @@ export default { iconSvgInline: () => EyeSvg, default: DefaultType.DEFAULT, enabled: (nodes) => { + // Disable if not located in user root + if (nodes.some(node => !(node.isDavRessource && node.root?.startsWith('/files')))) { + return false + } // Faster to check if at least one node doesn't match the requirements return !nodes.some(node => ( (node.permissions & Permission.READ) === 0