This commit is contained in:
Philipinho
2026-04-13 23:16:50 +01:00
parent de09ce7520
commit e77afb83ed
@@ -55,7 +55,7 @@ export default function AiChatLayout() {
navigate(location.pathname, { replace: true, state: null }); navigate(location.pathname, { replace: true, state: null });
}, [chatId, location, navigate, sendMessage]); }, [chatId, location, navigate, sendMessage]);
const hasMessages = messages.length > 0 || isStreaming; const hasMessages = messages.length > 0 || isStreaming || !!chatId;
// While the redirect effect is running (or if the user is still on this // While the redirect effect is running (or if the user is still on this
// component for any reason) never render the chat UI for a forbidden chat. // component for any reason) never render the chat UI for a forbidden chat.
@@ -65,6 +65,14 @@ export default function AiChatLayout() {
return ( return (
<div className={classes.main}> <div className={classes.main}>
{hasMessages ? (
<>
<ChatMessageList
messages={messages}
isStreaming={isStreaming}
streamingContent={streamingContent}
streamingToolCalls={streamingToolCalls}
/>
{error && ( {error && (
<div <div
style={{ style={{
@@ -76,15 +84,6 @@ export default function AiChatLayout() {
{error} {error}
</div> </div>
)} )}
{hasMessages ? (
<>
<ChatMessageList
messages={messages}
isStreaming={isStreaming}
streamingContent={streamingContent}
streamingToolCalls={streamingToolCalls}
/>
<div className={classes.inputArea}> <div className={classes.inputArea}>
<ChatInput <ChatInput
isStreaming={isStreaming} isStreaming={isStreaming}