Add check for monitor type to abort certificate check if not http type

This commit is contained in:
Alex Holliday
2024-08-28 10:53:02 -07:00
parent 6a5b72416c
commit bb396f7cfd

View File

@@ -142,6 +142,9 @@ const DetailsPage = ({ isAdmin }) => {
useEffect(() => {
const fetchCertificate = async () => {
if (monitor?.type !== "http") {
return;
}
try {
const res = await networkService.getCertificateExpiry(
authToken,
@@ -153,7 +156,7 @@ const DetailsPage = ({ isAdmin }) => {
}
};
fetchCertificate();
}, [authToken, monitorId]);
}, [authToken, monitorId, monitor]);
const theme = useTheme();
let loading = Object.keys(monitor).length === 0;