fix: eager load 2nd level replies so all nesting levels render correctly
This commit is contained in:
@@ -180,7 +180,7 @@ class CommentItem extends Component implements HasForms
|
|||||||
|
|
||||||
app(MentionParser::class)->syncMentions($reply);
|
app(MentionParser::class)->syncMentions($reply);
|
||||||
|
|
||||||
$this->comment->load(['replies.commenter', 'replies.mentions', 'replies.attachments', 'replies.reactions.commenter']);
|
$this->comment->load(['replies.commenter', 'replies.mentions', 'replies.attachments', 'replies.reactions.commenter', 'replies.replies.commenter', 'replies.replies.mentions', 'replies.replies.attachments', 'replies.replies.reactions.commenter']);
|
||||||
|
|
||||||
$this->dispatch('commentUpdated');
|
$this->dispatch('commentUpdated');
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class Comments extends Component implements HasForms
|
|||||||
{
|
{
|
||||||
return $this->model
|
return $this->model
|
||||||
->topLevelComments()
|
->topLevelComments()
|
||||||
->with(['commenter', 'mentions', 'attachments', 'reactions.commenter', 'replies.commenter', 'replies.mentions', 'replies.attachments', 'replies.reactions.commenter'])
|
->with(['commenter', 'mentions', 'attachments', 'reactions.commenter', 'replies.commenter', 'replies.mentions', 'replies.attachments', 'replies.reactions.commenter', 'replies.replies.commenter', 'replies.replies.mentions', 'replies.replies.attachments', 'replies.replies.reactions.commenter'])
|
||||||
->orderBy('created_at', $this->sortDirection)
|
->orderBy('created_at', $this->sortDirection)
|
||||||
->take($this->loadedCount)
|
->take($this->loadedCount)
|
||||||
->get();
|
->get();
|
||||||
|
|||||||
Reference in New Issue
Block a user