diff --git a/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js b/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js index a3f8f02cbd..91605c5336 100644 --- a/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js +++ b/frontend/src/components/shared-repo-list-view/shared-repo-list-item.js @@ -186,15 +186,18 @@ class SharedRepoListItem extends React.Component { this.props.onItemDetails(this.props.repo); } - onItemShare = () => { + onItemShare = (e) => { + e.preventDefault(); this.setState({isShowSharedDialog: true}); } - onItemUnshare = () => { + onItemUnshare = (e) => { + e.preventDefault(); this.props.onItemUnshare(this.props.repo); } - onItemDeleteToggle = () => { + onItemDeleteToggle = (e) => { + e.preventDefault(); this.setState({isDeleteDialogShow: !this.state.isDeleteDialogShow}); } @@ -389,9 +392,9 @@ class SharedRepoListItem extends React.Component { // scene two: (Share, Unshare), (Share), (Unshare) operations = this.generatorOperations(); } - const shareOperation = ; - const unshareOperation = ; - const deleteOperation = ; + const shareOperation = ; + const unshareOperation = ; + const deleteOperation = ; if (this.isDeparementOnwerGroupMember) { return ( @@ -435,7 +438,8 @@ class SharedRepoListItem extends React.Component { return null; } - onStarRepo = () => { + onToggleStarRepo = (e) => { + e.preventDefault(); if (this.state.isStarred) { seafileAPI.unstarItem(this.props.repo.repo_id, '/').then(() => { this.setState({isStarred: !this.state.isStarred}); @@ -458,10 +462,11 @@ class SharedRepoListItem extends React.Component { let { repo } = this.props; return ( - + - {!this.state.isStarred && } - {this.state.isStarred && } + + + {iconTitle} diff --git a/frontend/src/pages/shared-libs/shared-libs.js b/frontend/src/pages/shared-libs/shared-libs.js index 6c078abb5c..903c520aca 100644 --- a/frontend/src/pages/shared-libs/shared-libs.js +++ b/frontend/src/pages/shared-libs/shared-libs.js @@ -169,7 +169,8 @@ class Item extends Component { this.setState({isShowSharedDialog: false}); } - onToggleStarRepo = () => { + onToggleStarRepo = (e) => { + e.preventDefault(); const repoName = this.props.data.repo_name; if (this.state.isStarred) { seafileAPI.unstarItem(this.props.data.repo_id, '/').then(() => {