fix: do not display 'Untitled'

This commit is contained in:
Henry Li
2026-01-17 15:48:43 +08:00
parent e2d0246827
commit be1e016ed4

View File

@@ -55,10 +55,15 @@ export default function ChatPage() {
isNewThread,
threadId,
});
const title = useMemo(
() => (isNewThread ? "" : titleOfThread(thread as unknown as AgentThread)),
[thread, isNewThread],
);
const title = useMemo(() => {
let result = isNewThread
? ""
: titleOfThread(thread as unknown as AgentThread);
if (result === "Untitled") {
result = "";
}
return result;
}, [thread, isNewThread]);
const handleSubmit = useSubmitThread({
isNewThread,