1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-07-08 04:30:28 +00:00

Merge pull request #3677 from haiwen/share-bug-repair

repair share bug
This commit is contained in:
Daniel Pan 2019-06-19 17:31:59 +08:00 committed by GitHub
commit 0c75ced2ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -458,13 +458,11 @@ class DirentListItem extends React.Component {
} }
renderItemOperation = () => { renderItemOperation = () => {
let { dirent, selectedDirentList, currentRepoInfo } = this.props; let { dirent, selectedDirentList, currentRepoInfo, showShareBtn } = this.props;
if (currentRepoInfo.permission === 'cloud-edit' || currentRepoInfo.permission === 'preview') { if (currentRepoInfo.permission === 'cloud-edit' || currentRepoInfo.permission === 'preview') {
return ''; return '';
} }
let isShowShareBtn = (dirent.type === 'dir' && this.props.showShareBtn) || canGenerateShareLink;
return ( return (
<Fragment> <Fragment>
{selectedDirentList.length > 1 ? {selectedDirentList.length > 1 ?
@ -475,7 +473,7 @@ class DirentListItem extends React.Component {
<li className="operation-group-item"> <li className="operation-group-item">
<i className="op-icon sf2-icon-download" title={gettext('Download')} onClick={this.onItemDownload}></i> <i className="op-icon sf2-icon-download" title={gettext('Download')} onClick={this.onItemDownload}></i>
</li> </li>
{isShowShareBtn && {showShareBtn &&
<li className="operation-group-item"> <li className="operation-group-item">
<i className="op-icon sf2-icon-share" title={gettext('Share')} onClick={this.onItemShare}></i> <i className="op-icon sf2-icon-share" title={gettext('Share')} onClick={this.onItemShare}></i>
</li> </li>
@ -505,7 +503,7 @@ class DirentListItem extends React.Component {
<li className="operation-group-item"> <li className="operation-group-item">
<i className="op-icon sf2-icon-download" title={gettext('Download')} onClick={this.onItemDownload}></i> <i className="op-icon sf2-icon-download" title={gettext('Download')} onClick={this.onItemDownload}></i>
</li> </li>
{isShowShareBtn && {showShareBtn &&
<li className="operation-group-item"> <li className="operation-group-item">
<i className="op-icon sf2-icon-share" title={gettext('Share')} onClick={this.onItemShare}></i> <i className="op-icon sf2-icon-share" title={gettext('Share')} onClick={this.onItemShare}></i>
</li> </li>