From a3c4fed4374a949de846bc3ee0dc2abc6b056f60 Mon Sep 17 00:00:00 2001 From: Refringe Date: Wed, 9 Oct 2024 14:15:01 -0600 Subject: [PATCH] Hydrate Auth Follows This change hydrates the authFollowerIds on component render. --- app/Livewire/User/FollowCards.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/app/Livewire/User/FollowCards.php b/app/Livewire/User/FollowCards.php index b95affe..c1847e1 100644 --- a/app/Livewire/User/FollowCards.php +++ b/app/Livewire/User/FollowCards.php @@ -23,6 +23,16 @@ class FollowCards extends Component #[Locked] public Collection $authFollowIds; + /** + * Render the component. + */ + public function render(): View + { + $this->updateAuthFollowIds(); + + return view('livewire.user.follow-cards'); + } + /** * Called when the user follows or unfollows a user. */ @@ -38,12 +48,4 @@ class FollowCards extends Component $this->dispatch('auth-follow-change'); } - - /** - * Render the component. - */ - public function render(): View - { - return view('livewire.user.follow-cards'); - } }