feat: Add option to enable chat with website by default

This commit is contained in:
n4ze3m
2025-01-18 22:04:39 +05:30
parent aacade6c84
commit 7443d0ab6b
19 changed files with 86 additions and 3 deletions

View File

@@ -134,7 +134,8 @@ export const SidepanelForm = ({ dropedFile }: Props) => {
speechToTextLanguage,
useOCR,
setUseOCR,
defaultInternetSearchOn
defaultInternetSearchOn,
defaultChatWithWebsite
} = useMessage()
React.useEffect(() => {
@@ -200,6 +201,10 @@ export const SidepanelForm = ({ dropedFile }: Props) => {
setWebSearch(true)
}
if (defaultChatWithWebsite) {
setChatMode("rag")
}
return () => {
textareaRef.current?.removeEventListener("drop", handleDrop)
textareaRef.current?.removeEventListener("dragover", handleDragOver)
@@ -212,6 +217,12 @@ export const SidepanelForm = ({ dropedFile }: Props) => {
}
}, [defaultInternetSearchOn])
React.useEffect(() => {
if (defaultChatWithWebsite) {
setChatMode("rag")
}
}, [defaultChatWithWebsite])
return (
<div className="px-3 pt-3 md:px-6 md:pt-6 bg-white dark:bg-[#262626] border rounded-t-xl border-gray-300 dark:border-gray-600">
<div