From 7bf29562b8c6a01c4f46864d4e1004603cdfff34 Mon Sep 17 00:00:00 2001 From: Mitch Frauenheim Date: Tue, 24 Oct 2023 10:15:04 -0700 Subject: [PATCH] Show epoch stamp if invalid --- src/components/pv/valuetable/ValueTable.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/pv/valuetable/ValueTable.js b/src/components/pv/valuetable/ValueTable.js index e1c1357..ddf9974 100644 --- a/src/components/pv/valuetable/ValueTable.js +++ b/src/components/pv/valuetable/ValueTable.js @@ -146,8 +146,10 @@ function ValueTable(props) { timestamp = new Date(message.seconds * 1000).toLocaleString(); } if (!props.snapshot) { - if (message.seconds !== 631152000) { - setPVTimestamp(timestamp) + if (pvSeverity === "INVALID" || message.severity === "INVALID") { + setPVTimestamp(timestamp); + } else if (message.seconds !== 631152000) { + setPVTimestamp(timestamp); } } } @@ -193,7 +195,7 @@ function ValueTable(props) { console.log("Unexpected message type: ", message); } } - }, [lastJsonMessage, props.pvMonitoring, props.snapshot, snapshot, pvPrecision]); + }, [lastJsonMessage, props.pvMonitoring, props.snapshot, snapshot, pvPrecision, pvSeverity]); if (props.isLoading) { return (