1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-03 07:55:36 +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

@@ -270,16 +270,16 @@ class TreeView extends React.Component {
menuList = [];
const { modify: canModify, delete: canDelete, copy: canCopy } = customPermission.permission;
const { create: canCreate, modify: canModify, delete: canDelete, copy: canCopy } = customPermission.permission;
if (!node) {
canModify && menuList.push(NEW_FOLDER, NEW_FILE);
canCreate && menuList.push(NEW_FOLDER, NEW_FILE);
return menuList;
}
if (node.object.type === 'dir') {
canModify && menuList.push(NEW_FOLDER, NEW_FILE);
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);