This commit is contained in:
Josh Hawkins 2025-01-06 12:17:11 -06:00
parent 6d1e08cc8d
commit da2f86d80d
2 changed files with 5 additions and 3 deletions

View File

@ -253,6 +253,7 @@ class WebPushClient(Communicator): # type: ignore[misc]
payload={},
title="Test Notification",
message="This is a test notification from Frigate.",
direct_url="/",
notification_type="test",
)
@ -309,4 +310,5 @@ class WebPushClient(Communicator): # type: ignore[misc]
self.cleanup_registrations()
def stop(self) -> None:
logger.info("Closing notification queue")
self.notification_thread.join()

View File

@ -144,7 +144,7 @@ export default function NotificationView({
setRegistration(null);
});
toast.success(
"Successfully registered for notifications. Restart to start receiving notifications.",
"Successfully registered for notifications. Restarting Frigate is required before any notifications (including a test notification) can be sent.",
{
position: "top-center",
},
@ -438,7 +438,7 @@ export default function NotificationView({
<div className="col-span-1">
<div className="mt-4 gap-2 space-y-6">
<div className="space-y-3">
<div className="flex flex-col gap-2 md:max-w-[50%]">
<Separator className="my-2 flex bg-secondary md:hidden" />
<Heading as="h4" className="my-2">
Device-Specific Settings
@ -486,7 +486,7 @@ export default function NotificationView({
>
{`${registration != null ? "Unregister" : "Register"} for notifications on this device`}
</Button>
{registration != null && (
{registration != null && registration.active && (
<Button
aria-label="Send a test notification"
onClick={() => sendTestNotification("notification_test")}