JS notifications aren't sent if there's no server connectivity. Is there a way around this?

I get this on the console: POST https://site.test/livewire/message/filament.core.notifications net::ERR_INTERNET_DISCONNECTED I trigger the notification from javascript, like so:
.catch((error) => {
new Notification()
.danger()
.title("Error sending request")
.body(error)
.send()
});
.catch((error) => {
new Notification()
.danger()
.title("Error sending request")
.body(error)
.send()
});
I wasn't expecting Filament to need the server to show a client-side notification, I just wanna let the user know that the request failed. If client-side notifications need the server, how should I handle this?
Solution:
The JS Notification is just an interface to prepare and emit a Livewire event, the actual notification is indeed a server-side thing. You could use a front-end library or a simple alert(), depending on the probability of this error happening...
Jump to solution
2 Replies
Solution
Patrick Boivin
The JS Notification is just an interface to prepare and emit a Livewire event, the actual notification is indeed a server-side thing. You could use a front-end library or a simple alert(), depending on the probability of this error happening...
hugh_jazz99
hugh_jazz99OP2y ago
Alright I see, ok the chances of this happening are pretty low so I’ll do an alert, thank you
Want results from more Discord servers?
Add your server