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

This commit is contained in:
Alex Holliday committed 2024-08-28 10:53:02 -07:00
1 parent 6a5b72416c
commit bb396f7cfd
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;