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,3 +1,4 @@
import { useSetModalState } from '@/hooks/commonHooks';
import { Layout } from 'antd';
import { useState } from 'react';
import { ReactFlowProvider } from 'reactflow';
@@ -10,6 +11,11 @@ const { Content } = Layout;
function RagFlow() {
const [collapsed, setCollapsed] = useState(false);
const {
visible: chatDrawerVisible,
hideModal: hideChatDrawer,
showModal: showChatDrawer,
} = useSetModalState();
useFetchDataOnMount();
@@ -18,9 +24,13 @@ function RagFlow() {
<ReactFlowProvider>
<Sider setCollapsed={setCollapsed} collapsed={collapsed}></Sider>
<Layout>
<FlowHeader></FlowHeader>
<FlowHeader showChatDrawer={showChatDrawer}></FlowHeader>
<Content style={{ margin: 0 }}>
<FlowCanvas sideWidth={collapsed ? 0 : 200}></FlowCanvas>
<FlowCanvas
sideWidth={collapsed ? 0 : 200}
chatDrawerVisible={chatDrawerVisible}
hideChatDrawer={hideChatDrawer}
></FlowCanvas>
</Content>
</Layout>
</ReactFlowProvider>