diff --git a/apps/masterbots.ai/components/shared/thread-accordion.tsx b/apps/masterbots.ai/components/shared/thread-accordion.tsx index db9a23aa7..87cd9691d 100644 --- a/apps/masterbots.ai/components/shared/thread-accordion.tsx +++ b/apps/masterbots.ai/components/shared/thread-accordion.tsx @@ -23,7 +23,6 @@ export function ThreadAccordion({ chat = false, showHeading = true }: ThreadAccordionProps) { - // initalMessages is coming from server ssr on load. the rest of messages on demand on mount const { data: pairs, error } = useQuery({ queryKey: [`messages-${thread.threadId}`], @@ -33,29 +32,29 @@ export function ThreadAccordion({ enabled: clientFetch }) - // update url when dialog opens and closes - useEffect(() => { - const initialUrl = location.href - const dir = - `c/${ - toSlug( - chat ? thread.chatbot.name : thread.chatbot.categories[0].category.name - )}` + // // update url when dialog opens and closes + // useEffect(() => { + // const initialUrl = location.href + // const dir = + // `c/${ + // toSlug( + // chat ? thread.chatbot.name : thread.chatbot.categories[0].category.name + // )}` - const threadUrl = `/${dir}/${thread.threadId}` - console.log(`Updating URL to ${threadUrl}, initialUrl was ${initialUrl}`) + // const threadUrl = `/${dir}/${thread.threadId}` + // console.log(`Updating URL to ${threadUrl}, initialUrl was ${initialUrl}`) - window.history.pushState({}, '', threadUrl) - return () => { - window.history.pushState({}, '', initialUrl) - } - }) + // window.history.pushState({}, '', threadUrl) + // return () => { + // window.history.pushState({}, '', initialUrl) + // } + // }) if (error) return
There was an error loading thread messages
// if no initial message and still loading show loading message // NOTE: its fast and transitions in. testing without this - if (!pairs.length) return null + if (!pairs?.length) return null return ( { return ( - { key ? ( + {key ? ( -
{p.userMessage.content}
+
{p.userMessage.content}
- ) : showHeading && key === 0 ? + ) : showHeading && key === 0 ? ( - - : null} + + ) : null}
{p.chatGptMessage.map((message, index) => (