Remove favorites count from profile page to have it not break on load

This commit is contained in:
yuriko 🦊 2025-05-24 19:31:42 -04:00
parent 827d125639
commit f64afa649a
2 changed files with 1 additions and 11 deletions

View file

@ -2,8 +2,6 @@
namespace App\Livewire\Pages;
use App\Models\Comment;
use App\Models\Post;
use App\Models\User;
use Livewire\Component;
@ -13,11 +11,6 @@ class Profile extends Component
public function render()
{
$favorite_posts = $this->user->favorites()->withType(Post::class)->count();
$favorite_comments = $this->user->favorites()->withType(Comment::class)->count();
return view('livewire.pages.profile', [
'favorite_posts' => $favorite_posts, 'favorite_comments' => $favorite_comments
])->title($this->user->name);
return view('livewire.pages.profile')->title($this->user->name);
}
}

View file

@ -7,9 +7,6 @@
<span class="wa-heading-m">
<wa-format-number value="{{ $user->posts->count() }}"></wa-format-number> {{ Str::plural('post', $user->posts->count()) }}
</span>
<span>
<wa-format-number value="{{ $favorite_posts }}"></wa-format-number> {{ Str::plural('favorite', $favorite_posts) }}
</span>
</wa-card>
<wa-card>