From bb396f7cfde4bb687012f077a7a8c84b33e90036 Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 28 Aug 2024 10:53:02 -0700 Subject: [PATCH] Add check for monitor type to abort certificate check if not http type --- Client/src/Pages/Monitors/Details/index.jsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Client/src/Pages/Monitors/Details/index.jsx b/Client/src/Pages/Monitors/Details/index.jsx index 019aa7845..edcccf8e4 100644 --- a/Client/src/Pages/Monitors/Details/index.jsx +++ b/Client/src/Pages/Monitors/Details/index.jsx @@ -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;