Skip to content

Commit

Permalink
minor updates to welcome flow
Browse files Browse the repository at this point in the history
  • Loading branch information
pablonyx committed Oct 27, 2024
1 parent c75c156 commit 623f651
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion web/src/app/chat/ChatPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,9 @@ export function ChatPage({

const { assistants: availableAssistants, finalAssistants } = useAssistants();

const [showApiKeyModal, setShowApiKeyModal] = useState(true);
const [showApiKeyModal, setShowApiKeyModal] = useState(
!shouldShowWelcomeModal
);

const { user, isAdmin, isLoadingUser } = useUser();

Expand Down
6 changes: 5 additions & 1 deletion web/src/app/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ import { fetchLLMProvidersSS } from "@/lib/llm/fetchLLMs";
import { LLMProviderDescriptor } from "../admin/configuration/llm/interfaces";
import { AssistantsProvider } from "@/components/context/AssistantsContext";
import { headers } from "next/headers";
import { hasCompletedWelcomeFlowSS } from "@/components/initialSetup/welcome/WelcomeModalWrapper";
import {
hasCompletedWelcomeFlowSS,
WelcomeModal,
} from "@/components/initialSetup/welcome/WelcomeModalWrapper";

export default async function Home({
searchParams,
Expand Down Expand Up @@ -180,6 +183,7 @@ export default async function Home({
<>
<HealthCheckBanner />
<InstantSSRAutoRefresh />
{shouldShowWelcomeModal && <WelcomeModal user={user} />}
{/* ChatPopup is a custom popup that displays a admin-specified message on initial user visit.
Only used in the EE version of the app. */}
<ChatPopup />
Expand Down
4 changes: 4 additions & 0 deletions web/src/components/initialSetup/welcome/WelcomeModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ export function _WelcomeModal({ user }: { user: User | null }) {
{popup}

<Modal
onOutsideClick={() => {
setWelcomeFlowComplete();
router.refresh();
}}
title={"Welcome to Danswer!"}
width="w-full max-h-[900px] overflow-y-scroll max-w-3xl"
>
Expand Down
1 change: 1 addition & 0 deletions web/src/components/search/SearchSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ import UnconfiguredProviderText from "../chat_search/UnconfiguredProviderText";
import { DateRangePickerValue } from "@tremor/react";
import { Tag } from "@/lib/types";
import { isEqual } from "lodash";
import { WelcomeModal } from "../initialSetup/welcome/WelcomeModalWrapper";

export type searchState =
| "input"
Expand Down

0 comments on commit 623f651

Please sign in to comment.