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:
@@ -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
|
||||||
});
|
});
|
||||||
|
@@ -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
|
||||||
});
|
});
|
||||||
|
@@ -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
|
||||||
});
|
});
|
||||||
|
@@ -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
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user