[common] Fix bug 48484
This commit is contained in:
parent
7b3c27c619
commit
5c63e5cb0e
|
@ -101,6 +101,9 @@ class CommentsController extends Component {
|
||||||
}
|
}
|
||||||
removeComment (id) {
|
removeComment (id) {
|
||||||
this.storeComments.removeComment(id);
|
this.storeComments.removeComment(id);
|
||||||
|
if (this.storeComments.showComments.length < 1) {
|
||||||
|
Device.phone ? f7.sheet.close('#view-comment-sheet') : f7.popover.close('#view-comment-popover');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
removeComments (data) {
|
removeComments (data) {
|
||||||
for (let i = 0; i < data.length; i++) {
|
for (let i = 0; i < data.length; i++) {
|
||||||
|
@ -481,8 +484,6 @@ class ViewCommentsController extends Component {
|
||||||
}
|
}
|
||||||
deleteComment (comment) {
|
deleteComment (comment) {
|
||||||
const api = Common.EditorApi.get();
|
const api = Common.EditorApi.get();
|
||||||
|
|
||||||
this.props.storeComments.removeShowComment(comment.uid);
|
|
||||||
comment && api.asc_removeComment(comment.uid);
|
comment && api.asc_removeComment(comment.uid);
|
||||||
}
|
}
|
||||||
deleteReply (comment, reply) {
|
deleteReply (comment, reply) {
|
||||||
|
|
|
@ -61,6 +61,7 @@ export class storeComments {
|
||||||
if (index !== -1) {
|
if (index !== -1) {
|
||||||
collection.splice(index, 1);
|
collection.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
this.removeShowComment(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeComment (id, changeComment) {
|
changeComment (id, changeComment) {
|
||||||
|
|
|
@ -759,7 +759,7 @@ const CommentList = inject("storeComments", "storeAppOptions")(observer(({storeC
|
||||||
};
|
};
|
||||||
|
|
||||||
const onViewNextComment = () => {
|
const onViewNextComment = () => {
|
||||||
if (currentIndex + 1 === comments.length) {
|
if (currentIndex + 1 >= comments.length) {
|
||||||
setCurrentIndex(0);
|
setCurrentIndex(0);
|
||||||
} else {
|
} else {
|
||||||
setCurrentIndex(currentIndex + 1);
|
setCurrentIndex(currentIndex + 1);
|
||||||
|
@ -767,7 +767,9 @@ const CommentList = inject("storeComments", "storeAppOptions")(observer(({storeC
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!comment) {
|
if(!comment) {
|
||||||
Device.phone ? f7.sheet.close('#view-comment-sheet') : f7.popover.close('#view-comment-popover');
|
if (comments.length > 0) {
|
||||||
|
onViewNextComment();
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue