From 1dd205c441deba38010257564a2b98a3fc855489 Mon Sep 17 00:00:00 2001 From: ajnart Date: Thu, 2 Mar 2023 19:57:24 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20StatusCode=20not=20being?= =?UTF-8?q?=20used=20properly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Dashboard/Tiles/Apps/AppPing.tsx | 4 +--- src/types/app.ts | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/Dashboard/Tiles/Apps/AppPing.tsx b/src/components/Dashboard/Tiles/Apps/AppPing.tsx index d94cdc676..0a14bb9f2 100644 --- a/src/components/Dashboard/Tiles/Apps/AppPing.tsx +++ b/src/components/Dashboard/Tiles/Apps/AppPing.tsx @@ -19,7 +19,7 @@ export const AppPing = ({ app }: AppPingProps) => { queryKey: ['ping', { id: app.id, name: app.name }], queryFn: async () => { const response = await fetch(`/api/modules/ping?url=${encodeURI(app.url)}`); - const isOk = app.network.okStatus.includes(response.status); + const isOk = app.network.statusCodes.includes(response.status.toString()); return { status: response.status, state: isOk ? 'online' : 'down', @@ -60,5 +60,3 @@ export const AppPing = ({ app }: AppPingProps) => { ); }; - -type PingState = 'loading' | 'down' | 'online'; diff --git a/src/types/app.ts b/src/types/app.ts index 2e611c031..ca933d2d4 100644 --- a/src/types/app.ts +++ b/src/types/app.ts @@ -23,7 +23,7 @@ interface AppBehaviourType { interface AppNetworkType { enabledStatusChecker: boolean; - okStatus: number[]; + statusCodes: string[]; } interface AppAppearanceType {