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 {
|
||||
comments: state.comments.map((c) => {
|
||||
const replies = c.replies.map((r) => {
|
||||
if (r.id === comment.id) {
|
||||
return {
|
||||
...r,
|
||||
status: 'hidden'
|
||||
};
|
||||
}
|
||||
|
||||
return r;
|
||||
});
|
||||
|
||||
if (c.id === comment.id) {
|
||||
return {
|
||||
...c,
|
||||
status: 'hidden'
|
||||
status: 'hidden',
|
||||
replies
|
||||
};
|
||||
}
|
||||
return c;
|
||||
|
||||
return {
|
||||
...c,
|
||||
replies
|
||||
};
|
||||
})
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue