fix: realtime check

This commit is contained in:
Andras Bacsai
2023-12-11 12:40:56 +01:00
parent e022492770
commit af6d94c0d8
2 changed files with 22 additions and 10 deletions

View File

@@ -8,6 +8,7 @@ class RealtimeConnection extends Component
{
public $checkConnection = false;
public $showNotification = false;
public $isNotificationEnabled = true;
public function render()
{
return view('livewire.realtime-connection');
@@ -18,8 +19,7 @@ class RealtimeConnection extends Component
$this->showNotification = false;
}
public function mount() {
$isRoot = auth()->user()->id === 0;
$showNotification = data_get(auth()->user(), 'is_notification_realtime_enabled');
$this->checkConnection = $isRoot && $showNotification;
$this->isNotificationEnabled = auth()->user()->is_notification_realtime_enabled;
$this->checkConnection = auth()->user()->id === 0;
}
}