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

[file view] modified star/unstar (#3028)

This commit is contained in:
llj
2019-03-01 16:01:37 +08:00
committed by Daniel Pan
parent 3db4759cde
commit f201fd981e
4 changed files with 8 additions and 8 deletions

View File

@@ -57,13 +57,13 @@ class ViewFileImage extends React.Component {
toggleStar = () => { toggleStar = () => {
if (this.state.isStarred) { if (this.state.isStarred) {
seafileAPI.unStarFile(repoID, filePath).then((res) => { seafileAPI.unStarItem(repoID, filePath).then((res) => {
this.setState({ this.setState({
isStarred: false isStarred: false
}); });
}); });
} else { } else {
seafileAPI.starFile(repoID, filePath).then((res) => { seafileAPI.starItem(repoID, filePath).then((res) => {
this.setState({ this.setState({
isStarred: true isStarred: true
}); });

View File

@@ -62,13 +62,13 @@ class ViewFileText extends React.Component {
toggleStar = () => { toggleStar = () => {
if (this.state.isStarred) { if (this.state.isStarred) {
seafileAPI.unStarFile(repoID, filePath).then((res) => { seafileAPI.unStarItem(repoID, filePath).then((res) => {
this.setState({ this.setState({
isStarred: false isStarred: false
}); });
}); });
} else { } else {
seafileAPI.starFile(repoID, filePath).then((res) => { seafileAPI.starItem(repoID, filePath).then((res) => {
this.setState({ this.setState({
isStarred: true isStarred: true
}); });

View File

@@ -38,13 +38,13 @@ class ViewFileVideo extends React.Component {
toggleStar = () => { toggleStar = () => {
if (this.state.isStarred) { if (this.state.isStarred) {
seafileAPI.unStarFile(repoID, filePath).then((res) => { seafileAPI.unStarItem(repoID, filePath).then((res) => {
this.setState({ this.setState({
isStarred: false isStarred: false
}); });
}); });
} else { } else {
seafileAPI.starFile(repoID, filePath).then((res) => { seafileAPI.starItem(repoID, filePath).then((res) => {
this.setState({ this.setState({
isStarred: true isStarred: true
}); });

View File

@@ -37,13 +37,13 @@ class ViewFileXmind extends React.Component {
toggleStar = () => { toggleStar = () => {
if (this.state.isStarred) { if (this.state.isStarred) {
seafileAPI.unStarFile(repoID, filePath).then((res) => { seafileAPI.unStarItem(repoID, filePath).then((res) => {
this.setState({ this.setState({
isStarred: false isStarred: false
}); });
}); });
} else { } else {
seafileAPI.starFile(repoID, filePath).then((res) => { seafileAPI.starItem(repoID, filePath).then((res) => {
this.setState({ this.setState({
isStarred: true isStarred: true
}); });