mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-12 22:25:24 +03:00
Show errors in UI
This commit is contained in:
parent
61f4bcdcdf
commit
273e7c07d1
@ -74,9 +74,18 @@ export default function NotificationView({
|
||||
applicationServerKey: publicKey,
|
||||
})
|
||||
.then((pushSubscription) => {
|
||||
axios.post("notifications/register", {
|
||||
sub: pushSubscription,
|
||||
});
|
||||
axios
|
||||
.post("notifications/register", {
|
||||
sub: pushSubscription,
|
||||
})
|
||||
.catch(() => {
|
||||
toast.error("Failed to save notification registration.", {
|
||||
position: "top-center",
|
||||
});
|
||||
pushSubscription.unsubscribe();
|
||||
registration.unregister();
|
||||
setRegistration(null);
|
||||
});
|
||||
toast.success(
|
||||
"Successfully registered for notifications. Restart to start receiving notifications.",
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user