Dispatch notifications to all component aliases
This commit is contained in:
@@ -15,12 +15,18 @@
|
||||
}
|
||||
|
||||
succeed(() => {
|
||||
if (window.Livewire?.dispatchTo) {
|
||||
window.Livewire.dispatchTo('notifications', 'notificationsSent');
|
||||
return;
|
||||
const dispatchTo = window.Livewire?.dispatchTo;
|
||||
if (dispatchTo) {
|
||||
['notifications', 'filament.notifications', 'filament-notifications'].forEach((name) => {
|
||||
try {
|
||||
dispatchTo(name, 'notificationsSent');
|
||||
} catch (error) {
|
||||
// ignore missing component names
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.Livewire.dispatch('notificationsSent');
|
||||
window.Livewire?.dispatch?.('notificationsSent');
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user