mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
fix: Improve monitor status retrieval logic in Overview component
This commit is contained in:
parent
32fa57c63b
commit
0733c15363
@ -725,13 +725,27 @@ const Overview: FunctionComponent<PageComponentProps> = (
|
||||
getResourcesInGroup(group);
|
||||
|
||||
for (const resource of resourcesInGroup) {
|
||||
let currentMonitorStatus: MonitorStatus | undefined =
|
||||
monitorStatuses.find((status: MonitorStatus) => {
|
||||
let currentMonitorStatus: MonitorStatus | undefined = undefined;
|
||||
|
||||
if (resource.monitor) {
|
||||
currentMonitorStatus = monitorStatuses.find((status: MonitorStatus) => {
|
||||
return (
|
||||
status._id?.toString() ===
|
||||
resource.monitor?.currentMonitorStatusId?.toString()
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
if (resource.monitorGroupId) {
|
||||
currentMonitorStatus = monitorStatuses.find((status: MonitorStatus) => {
|
||||
return (
|
||||
status._id?.toString() ===
|
||||
monitorGroupCurrentStatuses[
|
||||
resource.monitorGroupId?.toString() || ""
|
||||
]?.toString()
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
if (!currentMonitorStatus) {
|
||||
currentMonitorStatus = currentStatus;
|
||||
|
Loading…
Reference in New Issue
Block a user