1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-10 03:11:07 +00:00

optimize code (#5300)

* optimize code

* update code

* optimize code
This commit is contained in:
杨顺强
2022-11-08 22:35:41 +08:00
committed by GitHub
parent c97947ea2a
commit 53e2e70d8c
5 changed files with 24 additions and 18 deletions

View File

@@ -207,7 +207,7 @@ class TreeNodeView extends React.Component {
let menuList = [RENAME, DELETE, COPY, MOVE, OPEN_VIA_CLIENT];
if (node.object.type === 'dir') {
menuList = [NEW_FOLDER, NEW_FILE, COPY, MOVE, RENAME, DELETE];
menuList = [NEW_FOLDER, NEW_FILE, COPY, MOVE, RENAME, DELETE];
}
const { userPerm } = this.props;
@@ -217,11 +217,11 @@ class TreeNodeView extends React.Component {
}
menuList = [];
const { modify: canModify, delete: canDelete, copy: canCopy } = customPermission.permission;
if (node.object.type === 'dir') {
canModify && menuList.push(NEW_FOLDER, NEW_FILE);
const { create: canCreate, modify: canModify, delete: canDelete, copy: canCopy } = customPermission.permission;
if (node.object.type === 'dir') {
canCreate && menuList.push(NEW_FOLDER, NEW_FILE);
}
canCopy && menuList.push(COPY);
canModify && menuList.push(MOVE, RENAME);
canDelete && menuList.push(DELETE);