We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d7b3798 commit 0a6b44dCopy full SHA for 0a6b44d
1 file changed
src/components/summary/Summary.tsx
@@ -51,9 +51,14 @@ export default function Summary() {
51
// const programStart = programStatus?.response?.program_start;
52
// const programVersion = programStatus?.response?.version;
53
54
+ // Find the most recent alert that is NOT OK/UP status
55
+ // state: 1 = host up, state: 8 = service ok
56
let quietForMs: number | null = null;
57
if (alertState && alertState.responseArray && alertState.responseArray.length > 0) {
- 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
+ }
62
}
63
64
const scrollDown = () => {
0 commit comments