From f6258df5a2a2393dfbdc8a717aecbe3a108bd547 Mon Sep 17 00:00:00 2001 From: Neshura Date: Thu, 16 Mar 2023 22:19:33 +0100 Subject: [PATCH] Added href check to services page since href is now optional --- pages/services.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pages/services.tsx b/pages/services.tsx index 354cd33..dd11625 100644 --- a/pages/services.tsx +++ b/pages/services.tsx @@ -4,7 +4,7 @@ import { ReactElement } from 'react' import useSWR from 'swr'; import ServiceList from '../public/data/pages.json'; import { DockerInfo } from '../interfaces/DockerStatus'; -import { CardContentService, PageContentBox, PageDescription, PageTitle } from '../components/styles/content'; +import { PageContentBox, PageDescription, PageTitle } from '../components/styles/content'; import useWindowSize from '../components/windowsize'; import { ServiceCardMobile } from '../components/styles/cards/mobile'; import { ServiceCardDesktop } from '../components/styles/cards/desktop'; @@ -85,7 +85,7 @@ async function getStatus(entry: Service, containers: DockerInfo[]) { // Others to follow but low prio as this is currently the only location used // Type APP - if (entry.type === ServiceType.app) { + if (entry.type === ServiceType.app && entry.href) { await fetch(entry.href) .then((response) => { if (response.ok) { @@ -126,10 +126,10 @@ async function getStatus(entry: Service, containers: DockerInfo[]) { default: console.log("Container Status " + container.status + " has no case implemented"); entry.status = Status.offline; - } - found = true; - // cancel the for - break; + } + found = true; + // cancel the for + break; } } // If container name is not missing the container is set to offline