Refactor workflowTip component to exclude message

This commit is contained in:
小石头 2024-04-16 15:08:31 +08:00
parent 9ebd041102
commit 4b75f3d85e

View File

@ -11,14 +11,14 @@ interface IProps {
const showTipArray = ["/unit_tests", "/pr", "/ask-code"];
const WorkflowTip = ({ messageIndex }: IProps) => {
// 单元测试、PR和Ask-code
const { chat } = useMst();
const { t } = useTranslation();
if (
messageIndex &&
chat.messages[messageIndex - 1] &&
chat.messages[messageIndex - 1]?.message?.startsWith("/") &&
showTipArray.includes(chat.messages[messageIndex - 1]?.message)
showTipArray.includes(chat.messages[messageIndex - 1]?.message) &&
!chat.messages[messageIndex]?.message?.includes("操作指南")
) {
const name = t(chat.messages[messageIndex - 1]?.message);
return (