From a68bc195766ad04bf7f3483c7a00f479e65a0c66 Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Thu, 26 Sep 2024 15:08:44 -0700 Subject: [PATCH 1/2] minor update --- .../initialSetup/welcome/WelcomeModal.tsx | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/web/src/components/initialSetup/welcome/WelcomeModal.tsx b/web/src/components/initialSetup/welcome/WelcomeModal.tsx index d2229ab9008..9797706bbbb 100644 --- a/web/src/components/initialSetup/welcome/WelcomeModal.tsx +++ b/web/src/components/initialSetup/welcome/WelcomeModal.tsx @@ -1,5 +1,6 @@ "use client"; +import React from "react"; import { Button, Divider, Text } from "@tremor/react"; import { Modal } from "../../Modal"; import Cookies from "js-cookie"; @@ -25,8 +26,8 @@ export function _CompletedWelcomeFlowDummyComponent() { export function _WelcomeModal({ user }: { user: User | null }) { const router = useRouter(); + const [canBegin, setCanBegin] = useState(false); - const [apiKeyVerified, setApiKeyVerified] = useState(false); const [providerOptions, setProviderOptions] = useState< WellKnownLLMProviderDescriptor[] >([]); @@ -41,19 +42,26 @@ export function _WelcomeModal({ user }: { user: User | null }) { useEffect(() => { async function fetchProviderInfo() { - const { providers, options, defaultCheckSuccessful } = - await checkLlmProvider(user); - setApiKeyVerified(providers.length > 0 && defaultCheckSuccessful); + const { options } = await checkLlmProvider(user); setProviderOptions(options); } fetchProviderInfo(); }, []); + // We should always have options + if (providerOptions.length === 0) { + return null; + } + return ( <> {popup} - + +
Danswer brings all your company's knowledge to your fingertips, @@ -61,8 +69,8 @@ export function _WelcomeModal({ user }: { user: User | null }) { To get started, we need to set up an API key for the Language Model - (LLM) provider. This key allows Danswer to interact with the AI - model, enabling intelligent responses to your queries. + (LLM) provider. This key allows Danswer to interact with the AI model, + enabling intelligent responses to your queries.
From 950489335c39ec1956cccc059dfcc90abf394490 Mon Sep 17 00:00:00 2001 From: pablodanswer Date: Mon, 7 Oct 2024 13:11:49 -0700 Subject: [PATCH 2/2] nit: pretty --- web/src/components/initialSetup/welcome/WelcomeModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/components/initialSetup/welcome/WelcomeModal.tsx b/web/src/components/initialSetup/welcome/WelcomeModal.tsx index 9797706bbbb..95f951d00a4 100644 --- a/web/src/components/initialSetup/welcome/WelcomeModal.tsx +++ b/web/src/components/initialSetup/welcome/WelcomeModal.tsx @@ -69,8 +69,8 @@ export function _WelcomeModal({ user }: { user: User | null }) { To get started, we need to set up an API key for the Language Model - (LLM) provider. This key allows Danswer to interact with the AI model, - enabling intelligent responses to your queries. + (LLM) provider. This key allows Danswer to interact with the AI + model, enabling intelligent responses to your queries.