Fix force search when selecting docs to chat with + fix selected document de-selection on chat switch

This commit is contained in:
Weves 2024-02-11 15:51:08 -08:00 committed by Chris Weaver
parent 7d11f5ffb8
commit 4629df06ef
2 changed files with 10 additions and 9 deletions

View File

@ -84,10 +84,7 @@ export const Chat = ({
textareaRef.current?.focus();
// only clear things if we're going from one chat session to another
if (
existingChatSessionId !== null &&
existingChatSessionId !== chatSessionId
) {
if (chatSessionId !== null && existingChatSessionId !== chatSessionId) {
// de-select documents
clearSelectedDocuments();
// reset all filters

View File

@ -14,6 +14,7 @@ import { SearchSummary, ShowHideDocsButton } from "./SearchSummary";
import { SourceIcon } from "@/components/SourceIcon";
import { ThreeDots } from "react-loader-spinner";
import { SkippedSearch } from "./SkippedSearch";
import { SelectedDocuments } from "../modifiers/SelectedDocuments";
export const Hoverable: React.FC<{
children: JSX.Element;
@ -99,11 +100,14 @@ export const AIMessage = ({
/>
</div>
)}
{handleForceSearch && content && query === undefined && (
<div className="my-1">
<SkippedSearch handleForceSearch={handleForceSearch} />
</div>
)}
{handleForceSearch &&
content &&
query === undefined &&
!hasDocs && (
<div className="my-1">
<SkippedSearch handleForceSearch={handleForceSearch} />
</div>
)}
{content ? (
<>