1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-08 10:22:46 +00:00

optimization code

This commit is contained in:
zxj96
2019-04-25 18:28:52 +08:00
parent 2c83d6882c
commit b79894cb72
4 changed files with 9 additions and 18 deletions

View File

@@ -413,18 +413,7 @@ class DirentListItem extends React.Component {
return '';
}
let isShowShareBtn = false;
if (this.props.showShareBtn) {
if (canGenerateShareLink) {
isShowShareBtn = true;
} else {
if (dirent.type === 'dir') {
isShowShareBtn = true;
} else {
isShowShareBtn = false;
}
}
}
let isShowShareBtn = (dirent.type === 'dir' && this.props.isShowShareBtn) || canGenerateShareLink;
return (
<Fragment>