Skip to content

Commit

Permalink
修复 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
chenshuai2144 committed Oct 25, 2023
1 parent 0f21706 commit fe3bf9d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/ProChat/components/InputArea/ActionBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const useStyles = createStyles(({ css, token }) => ({
}));

export const ActionBar = () => {
const [dispatchMessage] = useStore((s) => [s.dispatchMessage]);
const [clearMessage] = useStore((s) => [s.clearMessage]);

const { styles, theme } = useStyles();

Expand All @@ -33,7 +33,7 @@ export const ActionBar = () => {
okButtonProps={{ danger: true }}
okText={'清空会话'}
onConfirm={() => {
dispatchMessage({ type: 'resetMessages' });
clearMessage();
}}
>
<ActionIcon title={'清空当前会话'} icon={Trash2} />
Expand Down
8 changes: 7 additions & 1 deletion src/ProChat/demos/default.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ export default () => {
const theme = useTheme();
return (
<div style={{ background: theme.colorBgLayout }}>
<ProChat request={'/api/chat'} config={example.config} />
<ProChat
request={'/api/chat'}
config={example.config}
onResetMessage={async () => {
console.log('数据清空');
}}
/>
</div>
);
};

0 comments on commit fe3bf9d

Please sign in to comment.