mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Fixed hide comment on replies
This commit is contained in:
parent
165e84d8e0
commit
b9740dbe1e
1 changed files with 18 additions and 2 deletions
|
@ -61,13 +61,29 @@ async function hideComment({state, adminApi, data: comment}) {
|
||||||
|
|
||||||
return {
|
return {
|
||||||
comments: state.comments.map((c) => {
|
comments: state.comments.map((c) => {
|
||||||
if (c.id === comment.id) {
|
const replies = c.replies.map((r) => {
|
||||||
|
if (r.id === comment.id) {
|
||||||
return {
|
return {
|
||||||
...c,
|
...r,
|
||||||
status: 'hidden'
|
status: 'hidden'
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
return c;
|
|
||||||
|
return r;
|
||||||
|
});
|
||||||
|
|
||||||
|
if (c.id === comment.id) {
|
||||||
|
return {
|
||||||
|
...c,
|
||||||
|
status: 'hidden',
|
||||||
|
replies
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
...c,
|
||||||
|
replies
|
||||||
|
};
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue