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 -9
View File
@@ -228,15 +228,8 @@ export default function LiveContextMenu({
useNotifications(camera);
const { payload: notificationSuspendUntil, send: sendNotificationSuspend } =
useNotificationSuspend(camera);
const [isSuspended, setIsSuspended] = useState<boolean>(false);
useEffect(() => {
if (notificationSuspendUntil) {
setIsSuspended(
notificationSuspendUntil !== "0" || notificationState === "OFF",
);
}
}, [notificationSuspendUntil, notificationState]);
const isSuspended =
notificationSuspendUntil !== "0" || notificationState === "OFF";
const handleSuspend = (duration: string) => {
if (duration === "off") {