Merge pull request #745 from bluewave-labs/fix/certificate-check

Add check for monitor type to abort certificate check if not http type, resolves #720
This commit is contained in:
Alexander Holliday authored and GitHub committed 2024-08-28 18:52:54 -07:00
commit b0db3cc000
1 file changed
+4 -1
+4 -1
View File
@@ -142,6 +142,9 @@ const DetailsPage = ({ isAdmin }) => {
useEffect(() => { useEffect(() => {
const fetchCertificate = async () => { const fetchCertificate = async () => {
if (monitor?.type !== "http") {
return;
}
try { try {
const res = await networkService.getCertificateExpiry( const res = await networkService.getCertificateExpiry(
authToken, authToken,
@@ -153,7 +156,7 @@ const DetailsPage = ({ isAdmin }) => {
} }
}; };
fetchCertificate(); fetchCertificate();
}, [authToken, monitorId]); }, [authToken, monitorId, monitor]);
const theme = useTheme(); const theme = useTheme();
let loading = Object.keys(monitor).length === 0; let loading = Object.keys(monitor).length === 0;