Skip to content

Commit 38766e1

Browse files
fix:[lar-135] fix blank slideover when user are not authenticate and … (#255)
1 parent f16aa32 commit 38766e1

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

app/Livewire/Pages/Forum/Index.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ public function reloadThreads(?int $channelId): void
6363
$this->dispatch('render');
6464
}
6565

66+
#[On('redirectToLogin')]
67+
public function redirectToLogin(): void
68+
{
69+
$this->redirectRoute('login', navigate: true);
70+
}
71+
6672
protected function applySearch(Builder $query): Builder
6773
{
6874
if ($this->search) {

resources/views/livewire/pages/forum/index.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<x-slot:buttons>
33
<x-buttons.primary
44
type="button"
5-
onclick="Livewire.dispatch('openPanel', { component: 'components.slideovers.thread-form' })"
5+
onclick="{{ Auth::check() ? 'Livewire.dispatch(\'openPanel\', { component: \'components.slideovers.thread-form\' })' : 'Livewire.dispatch(\'redirectToLogin\') ' }}"
66
class="gap-2 w-full justify-center py-2.5"
77
>
88
{{ __('pages/forum.new_thread') }}

0 commit comments

Comments
 (0)