diff --git a/apps/masterbots.ai/components/routes/c/chat-search-input.tsx b/apps/masterbots.ai/components/routes/c/chat-search-input.tsx
index 80b67f24..20159105 100644
--- a/apps/masterbots.ai/components/routes/c/chat-search-input.tsx
+++ b/apps/masterbots.ai/components/routes/c/chat-search-input.tsx
@@ -14,7 +14,7 @@ import { getCategory } from '@/services/hasura'
export function ChatSearchInput({
setThreads
}: {
- setThreads: React.Dispatch
>
+ setThreads?: React.Dispatch>
}) {
const { chatbot } = useParams()
const { activeCategory } = useSidebar()
@@ -43,24 +43,25 @@ export function ChatSearchInput({
React.useEffect(() => {
debounce(() => {
- setThreads(prevState => {
- // ? If there is no results on a search, we should keep the previous state
- // ? and if not, the threads previous state before the search will be lost.
- previousThread.current = !previousThread.current.length
- ? prevState
- : previousThread.current
- const previousThreadState = previousThread.current
+ setThreads &&
+ setThreads(prevState => {
+ // ? If there is no results on a search, we should keep the previous state
+ // ? and if not, the threads previous state before the search will be lost.
+ previousThread.current = !previousThread.current.length
+ ? prevState
+ : previousThread.current
+ const previousThreadState = previousThread.current
- if (!keyword) {
- return previousThreadState
- }
+ if (!keyword) {
+ return previousThreadState
+ }
- return previousThreadState.filter((thread: Thread) =>
- thread.messages[0]?.content
- .toLowerCase()
- .includes(keyword.toLowerCase())
- )
- })
+ return previousThreadState.filter((thread: Thread) =>
+ thread.messages[0]?.content
+ .toLowerCase()
+ .includes(keyword.toLowerCase())
+ )
+ })
}, 230)()
}, [keyword])
diff --git a/apps/masterbots.ai/components/routes/c/new-chat.tsx b/apps/masterbots.ai/components/routes/c/new-chat.tsx
index a3dc56a2..7c4eddd8 100644
--- a/apps/masterbots.ai/components/routes/c/new-chat.tsx
+++ b/apps/masterbots.ai/components/routes/c/new-chat.tsx
@@ -14,7 +14,6 @@ export function NewChatInput({
id,
initialMessages,
chatbot,
- scrollToBottom = () => {},
dialog = false
}: NewChatInputProps) {
const router = useRouter()
@@ -73,7 +72,6 @@ export function NewChatInput({
messages={messages}
placeholder={`Start New Chat with ${chatbot.name}`}
reload={reload}
- scrollToBottom={scrollToBottom}
setInput={setInput}
showReload={false}
stop={stop}
diff --git a/apps/masterbots.ai/components/shared/thread-accordion.tsx b/apps/masterbots.ai/components/shared/thread-accordion.tsx
index 11e92a1f..d48af8e6 100644
--- a/apps/masterbots.ai/components/shared/thread-accordion.tsx
+++ b/apps/masterbots.ai/components/shared/thread-accordion.tsx
@@ -78,6 +78,7 @@ export function ThreadAccordion({
thread={thread}
question={p.userMessage.content}
copy={true}
+ chat={chat}
/>
)}
diff --git a/apps/masterbots.ai/components/shared/thread-dialog.tsx b/apps/masterbots.ai/components/shared/thread-dialog.tsx
index 66129f68..4a186122 100644
--- a/apps/masterbots.ai/components/shared/thread-dialog.tsx
+++ b/apps/masterbots.ai/components/shared/thread-dialog.tsx
@@ -14,12 +14,12 @@ import { DialogProps } from '@radix-ui/react-dialog'
import { NewChatInput } from '../routes/c/new-chat'
import { convertMessage } from '@/lib/threads'
-export function ThreadDialog({ thread, chat }: ThreadDialogProps) {
+export function ThreadDialog({ thread, chat = false }: ThreadDialogProps) {
const firstQuestion =
thread.messages.find(m => m.role === 'user')?.content || 'not found'
const firstResponse =
thread.messages.find(m => m.role === 'assistant')?.content || 'not found'
- console.log({ chat })
+
return (