From 56d56b50180bed5d2f45e6aac95cece4e5f85e96 Mon Sep 17 00:00:00 2001 From: Mary Hipp Date: Fri, 25 Aug 2023 14:06:18 -0400 Subject: [PATCH] add logging --- .../frontend/web/src/app/components/InvokeAIUI.tsx | 2 ++ invokeai/frontend/web/src/services/api/index.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+) diff --git a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx index 884f7a4865..12c8a8e8f6 100644 --- a/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx +++ b/invokeai/frontend/web/src/app/components/InvokeAIUI.tsx @@ -39,6 +39,7 @@ const InvokeAIUI = ({ }: Props) => { const [isReady, setIsReady] = useState(false); useEffect(() => { + console.log({ apiUrl }); if (token && apiUrl && projectId) { $authToken.set(token); $baseUrl.set(apiUrl); @@ -49,6 +50,7 @@ const InvokeAIUI = ({ $baseUrl.set(apiUrl); setIsReady(true); } else { + $baseUrl.set(''); setIsReady(true); } diff --git a/invokeai/frontend/web/src/services/api/index.ts b/invokeai/frontend/web/src/services/api/index.ts index a9de7130c9..176b9e6c71 100644 --- a/invokeai/frontend/web/src/services/api/index.ts +++ b/invokeai/frontend/web/src/services/api/index.ts @@ -7,6 +7,7 @@ import { fetchBaseQuery, } from '@reduxjs/toolkit/query/react'; import { $authToken, $baseUrl, $projectId } from 'services/api/client'; +import { undefined } from 'zod'; export const tagTypes = [ 'Board', @@ -29,6 +30,17 @@ const dynamicBaseQuery: BaseQueryFn< FetchBaseQueryError > = async (args, api, extraOptions) => { const baseUrl = $baseUrl.get(); + console.log({ baseUrl }) + if (baseUrl === undefined) { + return { + error: { + status: 400, + statusText: 'Bad Request', + data: 'No baseUrl set', + }, + } + } + const authToken = $authToken.get(); const projectId = $projectId.get();