diff --git a/src/ProChat/components/InputArea/ActionBar.tsx b/src/ProChat/components/InputArea/ActionBar.tsx index cea10e6c..22969976 100644 --- a/src/ProChat/components/InputArea/ActionBar.tsx +++ b/src/ProChat/components/InputArea/ActionBar.tsx @@ -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(); @@ -33,7 +33,7 @@ export const ActionBar = () => { okButtonProps={{ danger: true }} okText={'清空会话'} onConfirm={() => { - dispatchMessage({ type: 'resetMessages' }); + clearMessage(); }} > diff --git a/src/ProChat/demos/default.tsx b/src/ProChat/demos/default.tsx index baa2dc1a..c42c867f 100644 --- a/src/ProChat/demos/default.tsx +++ b/src/ProChat/demos/default.tsx @@ -10,7 +10,13 @@ export default () => { const theme = useTheme(); return (
- + { + console.log('数据清空'); + }} + />
); };