mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-04 08:28:11 +00:00
@@ -50,7 +50,9 @@ class DirentDetail extends React.Component {
|
||||
|
||||
componentWillReceiveProps(nextProps) {
|
||||
let { dirent, path, repoID } = nextProps;
|
||||
if (this.props.dirent !== nextProps.dirent) {
|
||||
this.loadDirentInfo(dirent, path, repoID);
|
||||
}
|
||||
if (this.props.direntDetailPanelTab) {
|
||||
this.tabItemClick(this.props.direntDetailPanelTab);
|
||||
}
|
||||
|
@@ -89,8 +89,8 @@ class ViewFileText extends React.Component {
|
||||
}
|
||||
|
||||
addParticipant = () => {
|
||||
seafileAPI.addFileParticipant(repoID, filePath, username).then((res) => {
|
||||
if (res.status === 201) {
|
||||
seafileAPI.addFileParticipants(repoID, filePath, [username]).then((res) => {
|
||||
if (res.status === 200) {
|
||||
this.isParticipant = true;
|
||||
this.getParticipants();
|
||||
}
|
||||
@@ -100,11 +100,12 @@ class ViewFileText extends React.Component {
|
||||
getParticipants = () => {
|
||||
seafileAPI.listFileParticipants(repoID, filePath).then((res) => {
|
||||
const participants = res.data.participant_list;
|
||||
if (participants.length === 0) return;
|
||||
this.setState({ participants: participants });
|
||||
if (participants.length > 0) {
|
||||
this.isParticipant = participants.every((participant) => {
|
||||
return participant.email == username;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user