Skip to content

Commit

Permalink
fix: Disable view file in trashbin
Browse files Browse the repository at this point in the history
Signed-off-by: Christopher Ng <[email protected]>
  • Loading branch information
Pytal committed Dec 6, 2023
1 parent c1aeed3 commit d3dfb79
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/views/Viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d3dfb79

Please sign in to comment.