Skip to content

Commit 0a6b44d

Browse files
Quiet For should exclude UP and OK items and not be negative
1 parent d7b3798 commit 0a6b44d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/components/summary/Summary.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,14 @@ export default function Summary() {
5151
// const programStart = programStatus?.response?.program_start;
5252
// const programVersion = programStatus?.response?.version;
5353

54+
// Find the most recent alert that is NOT OK/UP status
55+
// state: 1 = host up, state: 8 = service ok
5456
let quietForMs: number | null = null;
5557
if (alertState && alertState.responseArray && alertState.responseArray.length > 0) {
56-
quietForMs = alertState.responseArray[0].timestamp;
58+
const nonOkAlert = alertState.responseArray.find(alert => alert.state !== 1 && alert.state !== 8);
59+
if (nonOkAlert) {
60+
quietForMs = nonOkAlert.timestamp;
61+
}
5762
}
5863

5964
const scrollDown = () => {

0 commit comments

Comments
 (0)