feat: Add option to enable chat with website by default
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user