feat: catch errors when sending messages #918 (#1113)

### What problem does this PR solve?

feat: catch errors when sending messages #918

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
balibabu
2024-06-11 15:46:12 +08:00
committed by GitHub
parent e28d13e3b4
commit 8902d92d0e
10 changed files with 51 additions and 44 deletions

View File

@ -1,21 +1,19 @@
import { Button, Flex, Space } from 'antd';
import { useSetModalState } from '@/hooks/commonHooks';
import { useFetchFlow } from '@/hooks/flow-hooks';
import { ArrowLeftOutlined } from '@ant-design/icons';
import { Link } from 'umi';
import ChatDrawer from '../chat/drawer';
import { useRunGraph, useSaveGraph } from '../hooks';
import { useSaveGraph } from '../hooks';
import styles from './index.less';
const FlowHeader = () => {
interface IProps {
showChatDrawer(): void;
}
const FlowHeader = ({ showChatDrawer }: IProps) => {
const { saveGraph } = useSaveGraph();
const { runGraph } = useRunGraph();
const {
visible: chatDrawerVisible,
hideModal: hideChatDrawer,
showModal: showChatDrawer,
} = useSetModalState();
const { data } = useFetchFlow();
return (
@ -41,10 +39,6 @@ const FlowHeader = () => {
</Button>
</Space>
</Flex>
<ChatDrawer
visible={chatDrawerVisible}
hideModal={hideChatDrawer}
></ChatDrawer>
</>
);
};