Compare commits

...

3 Commits

Author SHA1 Message Date
Lance Pioch
fb0d7f44b9 Replace ineffective session polling with navigate-based refresh
Session-based polling doesn't work because nothing replenishes session
data during poll requests. Instead, listen for Livewire's navigated
event to re-pull session data after SPA page transitions, which catches
banners pushed by the new page's mount lifecycle.
2026-02-07 23:32:25 -05:00
Lance Pioch
64c8930d39 Fix Livewire poll to call pullFromSession on each cycle
wire:poll alone only re-renders without pulling new banners from the
session. Specify pullFromSession as the poll method so new alert banners
are picked up without a page refresh.
2026-02-07 22:08:49 -05:00
Lance Pioch
61a9cbbc6c Auto-update alert banners with Livewire polling (#1492)
Add wire:poll.visible.15s to the alert banner container so new alerts
are picked up without requiring a manual page refresh.
2026-02-06 01:52:25 -05:00

View File

@@ -1,4 +1,9 @@
<div id="alert-banner-container" class="flex flex-col gap-4">
<div
x-data
x-init="document.addEventListener('livewire:navigated', () => $wire.pullFromSession())"
id="alert-banner-container"
class="flex flex-col gap-4"
>
@foreach ($alertBanners as $alertBanner)
{{ $alertBanner }}
@endforeach