mirror of
https://github.com/flarum/framework.git
synced 2025-01-19 18:12:59 +08:00
Refresh comments count when updating metadata
This commit is contained in:
parent
227f19ddf6
commit
624d3d70bb
|
@ -42,7 +42,7 @@ class DiscussionMetadataUpdater extends EventListener
|
|||
{
|
||||
$discussion = $this->discussionRepo->find($event->post->discussion_id);
|
||||
|
||||
$discussion->comments_count++;
|
||||
$discussion->refreshCommentsCount();
|
||||
$discussion->refreshLastPost();
|
||||
|
||||
$this->discussionRepo->save($discussion);
|
||||
|
@ -52,7 +52,7 @@ class DiscussionMetadataUpdater extends EventListener
|
|||
{
|
||||
$discussion = $this->discussionRepo->find($post->discussion_id);
|
||||
|
||||
$discussion->comments_count--;
|
||||
$discussion->refreshCommentsCount();
|
||||
|
||||
if ($discussion->last_post_id == $post->id) {
|
||||
$discussion->refreshLastPost();
|
||||
|
|
Loading…
Reference in New Issue
Block a user