fix: empty input message on empty streaming (#2729)
Fixed streaming bug where it shows a message before starting streaming
This commit is contained in:
parent
b7223063c7
commit
caae43bc9b
2 changed files with 10 additions and 7 deletions
|
|
@ -853,6 +853,8 @@ export const TITLE_ERROR_UPDATING_COMPONENT =
|
|||
|
||||
export const EMPTY_INPUT_SEND_MESSAGE = "No input message provided.";
|
||||
|
||||
export const EMPTY_OUTPUT_SEND_MESSAGE = "Message empty.";
|
||||
|
||||
export const TABS_ORDER = [
|
||||
"run curl",
|
||||
"python api",
|
||||
|
|
|
|||
|
|
@ -9,7 +9,10 @@ import Robot from "../../../../../assets/robot.png";
|
|||
import CodeTabsComponent from "../../../../../components/codeTabsComponent";
|
||||
import IconComponent from "../../../../../components/genericIconComponent";
|
||||
import SanitizedHTMLWrapper from "../../../../../components/sanitizedHTMLWrapper";
|
||||
import { EMPTY_INPUT_SEND_MESSAGE } from "../../../../../constants/constants";
|
||||
import {
|
||||
EMPTY_INPUT_SEND_MESSAGE,
|
||||
EMPTY_OUTPUT_SEND_MESSAGE,
|
||||
} from "../../../../../constants/constants";
|
||||
import useAlertStore from "../../../../../stores/alertStore";
|
||||
import useFlowStore from "../../../../../stores/flowStore";
|
||||
import { chatMessagePropsType } from "../../../../../types/components";
|
||||
|
|
@ -251,8 +254,8 @@ export default function ChatMessage({
|
|||
},
|
||||
}}
|
||||
>
|
||||
{chatMessage === ""
|
||||
? EMPTY_INPUT_SEND_MESSAGE
|
||||
{chatMessage === "" && !chat.stream_url
|
||||
? EMPTY_OUTPUT_SEND_MESSAGE
|
||||
: chatMessage}
|
||||
</Markdown>
|
||||
),
|
||||
|
|
@ -286,10 +289,8 @@ export default function ChatMessage({
|
|||
className={cn(
|
||||
"prose word-break-break-word dark:prose-invert",
|
||||
chatMessage !== ""
|
||||
? EMPTY_INPUT_SEND_MESSAGE
|
||||
: chatMessage
|
||||
? "text-primary"
|
||||
: "text-chat-trigger-disabled",
|
||||
? "text-primary"
|
||||
: "text-chat-trigger-disabled",
|
||||
)}
|
||||
>
|
||||
{promptOpen
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue