mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 07:42:10 +00:00
Fix null checks for currentStatus in Overview component and update variable declaration for currentMonitorStatus
This commit is contained in:
parent
89da4dea4c
commit
ea0a9d94bc
@ -373,7 +373,9 @@ const Overview: FunctionComponent<PageComponentProps> = (
|
||||
|
||||
if (
|
||||
!downtimeMonitorStatuses.find((downtimeStatus: MonitorStatus) => {
|
||||
return currentStatus.id?.toString() === downtimeStatus.id?.toString();
|
||||
return (
|
||||
currentStatus?.id?.toString() === downtimeStatus?.id?.toString()
|
||||
);
|
||||
}) &&
|
||||
data.group.showUptimePercent
|
||||
) {
|
||||
@ -723,7 +725,7 @@ const Overview: FunctionComponent<PageComponentProps> = (
|
||||
getResourcesInGroup(group);
|
||||
|
||||
for (const resource of resourcesInGroup) {
|
||||
const currentMonitorStatus: MonitorStatus | undefined =
|
||||
let currentMonitorStatus: MonitorStatus | undefined =
|
||||
monitorStatuses.find((status: MonitorStatus) => {
|
||||
return (
|
||||
status._id?.toString() ===
|
||||
@ -731,6 +733,10 @@ const Overview: FunctionComponent<PageComponentProps> = (
|
||||
);
|
||||
});
|
||||
|
||||
if (!currentMonitorStatus) {
|
||||
currentMonitorStatus = currentStatus;
|
||||
}
|
||||
|
||||
if (
|
||||
(currentStatus &&
|
||||
currentStatus.priority &&
|
||||
|
Loading…
Reference in New Issue
Block a user