0
Fork 0
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:
Kevin Ansfield 2022-07-07 14:33:37 +02:00
parent 165e84d8e0
commit b9740dbe1e

View file

@ -61,13 +61,29 @@ async function hideComment({state, adminApi, data: comment}) {
return {
comments: state.comments.map((c) => {
if (c.id === comment.id) {
const replies = c.replies.map((r) => {
if (r.id === comment.id) {
return {
...c,
...r,
status: 'hidden'
};
}
return c;
return r;
});
if (c.id === comment.id) {
return {
...c,
status: 'hidden',
replies
};
}
return {
...c,
replies
};
})
};
}