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:
Josh Hawkins
2026-08-13 16:51:44 -06:00
committed by GitHub
parent fd98977506
commit 812e5308a3
4 changed files with 17 additions and 26 deletions
+2 -2
View File
@@ -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(): {