-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support onResetMessage funtion #2
Conversation
🎊 PR Preview 0f21706 has been successfully built and deployed to https://ant-design-pro-chat-preview-pr-2.surge.sh 🕐 Build time: 115.107s 🤖 By surge-preview |
const { dispatchMessage, onResetMessage } = get(); | ||
|
||
// 重置消息,清空聊天记录,等待 onResetMessage 完成后再清空 | ||
if (onResetMessage) await onResetMessage(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
应该在 dispatch 后触发?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
要是这个失败了,就不要触发后面的了,不然和服务器上的数据不同步了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
那 这个方法应该不叫 onResetMessage 吧? 叫beforeResetMessage
更合适?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on 更像是触发完成以后的回调?
## [Version 0.2.0-beta.9](v0.2.0-beta.8...v0.2.0-beta.9) <sup>Released on **2023-10-25**</sup> #### ✨ 新特性 - Support onResetMessage funtion. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * Support onResetMessage funtion, closes [#2](#2) ([418230a](418230a)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
🎉 This PR is included in version 0.2.0-beta.9 🎉 The release is available on: Your semantic-release bot 📦🚀 |
## [Version 0.2.0](v0.1.1...v0.2.0) <sup>Released on **2023-11-24**</sup> #### ✨ 新特性 - Add ProChat, add ProChat, change action & group as pro-editor, init basic components, ProChat 初步组件化, support autocompleteRequest and messageItemExtraRender, support extra userMeta and params, support onResetMessage funtion, support useChat and chatRef, 支持流式响应, 支持非流式请求. #### 🐛 修复 - Change action group style problem, clean deps, fix avatar, fix import, fix import, fix import, fix onPressEnter no work error, fix onResetMessage, fix send auto clear no work error, lock father to fix build. <br/> <details> <summary><kbd>Improvements and Fixes</kbd></summary> #### What's improved * Add ProChat, closes [#1](#1) ([d63f00a](d63f00a)) * Add ProChat ([ec20b42](ec20b42)) * Change action & group as pro-editor ([4f1d5ee](4f1d5ee)) * Init basic components ([09d1284](09d1284)) * ProChat 初步组件化 ([86e8283](86e8283)) * Support autocompleteRequest and messageItemExtraRender, closes [#4](#4) ([5305e56](5305e56)) * Support extra userMeta and params, closes [#10](#10) ([8475b9a](8475b9a)) * Support onResetMessage funtion, closes [#2](#2) ([418230a](418230a)) * Support useChat and chatRef ([cf98b0f](cf98b0f)) * 支持流式响应 ([4e6d720](4e6d720)) * 支持非流式请求 ([211fad5](211fad5)) #### What's fixed * Change action group style problem ([52c9104](52c9104)) * Clean deps ([1479fa3](1479fa3)) * Fix avatar ([61a7efe](61a7efe)) * Fix import ([ac81b1d](ac81b1d)) * Fix import ([565e530](565e530)) * Fix import ([0311e5f](0311e5f)) * Fix onPressEnter no work error, closes [#11](#11) ([1db28f7](1db28f7)) * Fix onResetMessage, closes [#3](#3) ([078f277](078f277)) * Fix send auto clear no work error, closes [#5](#5) ([06f6ebf](06f6ebf)) * Lock father to fix build ([f6618e5](f6618e5)) </details> <div align="right"> [![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top) </div>
🎉 This PR is included in version 0.2.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
💻 变更类型 | Change Type
🔀 变更说明 | Description of Change
📝 补充信息 | Additional Information