fix: realtime check
This commit is contained in:
parent
e022492770
commit
af6d94c0d8
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -8,28 +8,40 @@
|
||||
if (window.Echo) {
|
||||
if (window.Echo.connector.pusher.connection.state !== 'connected') {
|
||||
checkNumber++;
|
||||
if (checkNumber > 5) {
|
||||
$wire.showNotification = true;
|
||||
if (checkNumber > 4) {
|
||||
@if ($isNotificationEnabled)
|
||||
$wire.showNotification = true;
|
||||
@endif
|
||||
console.error(
|
||||
'Coolify could not connect to the new realtime service introduced in beta.154. This will cause unusual problems on the UI if not fixed! Please check the related documentation (https://coolify.io/docs/cloudflare-tunnels) or get help on Discord (https://coollabs.io/discord).)'
|
||||
);
|
||||
clearInterval(checkPusherInterval);
|
||||
}
|
||||
} else {
|
||||
console.log('Coolify is now connected to the new realtime service introduced in beta.154.');
|
||||
clearInterval(checkPusherInterval);
|
||||
$wire.showNotification = true;
|
||||
}
|
||||
} else {
|
||||
$wire.showNotification = true;
|
||||
@if ($isNotificationEnabled)
|
||||
$wire.showNotification = true;
|
||||
@endif
|
||||
console.error(
|
||||
'Coolify could not connect to the new realtime service introduced in beta.154. This will cause unusual problems on the UI if not fixed! Please check the related documentation (https://coolify.io/docs/cloudflare-tunnels) or get help on Discord (https://coollabs.io/discord).)'
|
||||
);
|
||||
clearInterval(checkPusherInterval);
|
||||
}
|
||||
}, 2000);
|
||||
}, 1000);
|
||||
</script>
|
||||
@endscript
|
||||
<div class="toast z-[9999]" x-cloak x-show="showNotification">
|
||||
<div class="flex flex-col text-white border border-red-500 border-dashed rounded alert bg-coolgray-200">
|
||||
<span><span class="font-bold text-left text-red-500">WARNING: </span>Coolify could not connect to the new realtime service introduced in beta.154. <br>This will cause unusual problems on the UI if not fixed!<br><br>Please check the
|
||||
<span><span class="font-bold text-left text-red-500">WARNING: </span>Coolify could not connect to the new
|
||||
realtime service introduced in beta.154. <br>This will cause unusual problems on the UI if not
|
||||
fixed!<br><br>Please check the
|
||||
related <a href='https://coolify.io/docs/cloudflare-tunnels' target='_blank'>documentation</a> or get
|
||||
help on <a href='https://coollabs.io/discord' target='_blank'>Discord</a>.</span>
|
||||
<x-forms.button class="bg-coolgray-400" wire:click='disable'>Acknowledge the problem and disable this popup</x-forms.button>
|
||||
<x-forms.button class="bg-coolgray-400" wire:click='disable'>Acknowledge the problem and disable this
|
||||
popup</x-forms.button>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user