1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-01 15:09:14 +00:00

star folder (#2955)

This commit is contained in:
lian
2019-02-18 20:26:55 +08:00
committed by Daniel Pan
parent 6a7a47e6cd
commit 5fd5b000e1
11 changed files with 391 additions and 42 deletions

View File

@@ -149,20 +149,16 @@ class ViewFileText extends React.Component {
toggleStar = () => {
if (this.state.star) {
seafileAPI.unStarFile(repoID, filePath).then((res) => {
if (res.data === 'success') {
this.setState({
star: false,
});
}
seafileAPI.unStarItem(repoID, filePath).then((res) => {
this.setState({
star: false,
});
});
} else {
seafileAPI.starFile(repoID, filePath).then((res) => {
if (res.data === 'success') {
this.setState({
star: true,
});
}
seafileAPI.starItem(repoID, filePath).then((res) => {
this.setState({
star: true,
});
});
}
}
@@ -322,4 +318,4 @@ if (enableWatermark) {
ReactDOM.render (
<ViewFileText />,
document.getElementById('root')
);
);