Skip to content

Commit

Permalink
✨ feat: 支持复制与编辑会话消息
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Jul 22, 2023
1 parent 3830601 commit bebcf9f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pages/chat/[id]/Conversation/ChatList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import MessageExtra from './MessageExtra';

const List = () => {
const data = useSessionStore(chatSelectors.currentChats, isEqual);
const [deleteMessage, resendMessage] = useSessionStore(
(s) => [s.deleteMessage, s.resendMessage],
const [deleteMessage, resendMessage, dispatchMessage] = useSessionStore(
(s) => [s.deleteMessage, s.resendMessage, s.dispatchMessage],
shallow,
);

Expand All @@ -30,6 +30,9 @@ const List = () => {
}
}
}}
onMessageChange={(id, content) => {
dispatchMessage({ id, key: 'content', type: 'updateMessage', value: content });
}}
renderMessageExtra={MessageExtra}
style={{ marginTop: 24 }}
/>
Expand Down

0 comments on commit bebcf9f

Please sign in to comment.