fix: do not display 'Untitled'

This commit is contained in:
Henry Li
2026-01-17 15:48:43 +08:00
parent 56da1c990a
commit 584eed0166

View File

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