From 3476d6087d0af319ad62e4350ef02d278c31afa1 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 12 Jun 2023 13:10:34 +0200 Subject: [PATCH] fix --- app/Http/Livewire/Team/InviteLink.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/Http/Livewire/Team/InviteLink.php b/app/Http/Livewire/Team/InviteLink.php index 1a46c2199..5ddaa9a54 100644 --- a/app/Http/Livewire/Team/InviteLink.php +++ b/app/Http/Livewire/Team/InviteLink.php @@ -19,7 +19,6 @@ class InviteLink extends Component public function viaEmail() { $this->generate_invite_link(isEmail: true); - $this->emit('message', 'Invitation sent via email successfully.'); } private function generate_invite_link(bool $isEmail = false) { @@ -60,6 +59,9 @@ class InviteLink extends Component ]); if ($isEmail) { $user->first()->notify(new InvitationLinkEmail()); + $this->emit('message', 'Invitation sent via email successfully.'); + } else { + $this->emit('message', 'Invitation link generated.'); } $this->emit('refreshInvitations'); } catch (\Throwable $e) { @@ -73,6 +75,5 @@ class InviteLink extends Component public function inviteByLink() { $this->generate_invite_link(); - $this->emit('message', 'Invitation link generated.'); } }