diff --git a/web/src/app/chat/ChatPage.tsx b/web/src/app/chat/ChatPage.tsx index 403c40b3dc4..caf56f8523c 100644 --- a/web/src/app/chat/ChatPage.tsx +++ b/web/src/app/chat/ChatPage.tsx @@ -161,6 +161,9 @@ export function ChatPage({ user, availableAssistants ); + const finalAssistants = user + ? orderAssistantsForUser(visibleAssistants, user) + : visibleAssistants; const existingChatSessionAssistantId = selectedChatSession?.persona_id; const [selectedAssistant, setSelectedAssistant] = useState< @@ -215,7 +218,7 @@ export function ChatPage({ const liveAssistant = alternativeAssistant || selectedAssistant || - visibleAssistants[0] || + finalAssistants[0] || availableAssistants[0]; useEffect(() => { @@ -685,7 +688,7 @@ export function ChatPage({ useEffect(() => { if (messageHistory.length === 0 && chatSessionIdRef.current === null) { setSelectedAssistant( - visibleAssistants.find((persona) => persona.id === defaultAssistantId) + finalAssistants.find((persona) => persona.id === defaultAssistantId) ); } }, [defaultAssistantId]); @@ -2384,10 +2387,7 @@ export function ChatPage({ showDocs={() => setDocumentSelection(true)} selectedDocuments={selectedDocuments} // assistant stuff - assistantOptions={orderAssistantsForUser( - visibleAssistants, - user - )} + assistantOptions={finalAssistants} selectedAssistant={liveAssistant} setSelectedAssistant={onAssistantChange} setAlternativeAssistant={setAlternativeAssistant} diff --git a/web/src/lib/chat/fetchChatData.ts b/web/src/lib/chat/fetchChatData.ts index d6a92410f04..fe6a5d9d717 100644 --- a/web/src/lib/chat/fetchChatData.ts +++ b/web/src/lib/chat/fetchChatData.ts @@ -188,14 +188,6 @@ export async function fetchChatData(searchParams: { !hasAnyConnectors && (!user || user.role === "admin"); - const shouldDisplaySourcesIncompleteModal = - hasAnyConnectors && - !shouldShowWelcomeModal && - !ccPairs.some( - (ccPair) => ccPair.has_successful_run && ccPair.docs_indexed > 0 - ) && - (!user || user.role == "admin"); - // if no connectors are setup, only show personas that are pure // passthrough and don't do any retrieval if (!hasAnyConnectors) {