mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-09-26 11:38:59 +03:00
fix notification suspend state lost on page reload (#23989)
<camera>/notifications/suspended arrives as a string over the live connection but as a number in the camera_activity snapshot, and the truthiness guard dropped the numeric 0, so a camera with notifications off rendered as active after a reload. Normalize to a string and derive isSuspended instead of storing it.
This commit is contained in:
+2
-2
@@ -205,7 +205,7 @@ function applyCameraActivity(payload: string) {
|
||||
);
|
||||
applyTopicUpdate(
|
||||
`${name}/notifications/suspended`,
|
||||
notifications_suspended || 0,
|
||||
String(notifications_suspended ?? 0),
|
||||
);
|
||||
applyTopicUpdate(
|
||||
`${name}/ptz_autotracker/state`,
|
||||
@@ -806,7 +806,7 @@ export function useNotificationSuspend(camera: string): {
|
||||
`${camera}/notifications/suspended`,
|
||||
`${camera}/notifications/suspend`,
|
||||
);
|
||||
return { payload: payload as string, send };
|
||||
return { payload: String(payload ?? 0), send };
|
||||
}
|
||||
|
||||
export function useNotificationTest(): {
|
||||
|
||||
Reference in New Issue
Block a user