6 Commits

Author SHA1 Message Date
Rankin Zheng
d4dc6db801 Enhance MessageMarkdown component and ChatStore
- Added observer from 'mobx-react-lite' and useMst from '@/views/stores/RootStore' to MessageMarkdown.
- Imported Message from '@/views/stores/ChatStore' and messageUtil from '@/util/MessageUtil' to MessageMarkdown.
- Added handleExplain and handleButton functions to MessageMarkdown to handle button clicks and anchor clicks.
- Updated button and anchor components in MessageMarkdown to use the new handleButton and handleExplain functions.
- Added useEffect hook in ChatPanel to handle scroll to bottom when chat.scrollBottom changes.
- Added scrollBottom property and goScrollBottom action to ChatStore.
2023-08-22 17:22:30 +08:00
Rankin Zheng
e0487015d6 Rename MessageContainer to MessageList
- Renamed MessageContainer component to MessageList for better clarity.
- Updated all references of MessageContainer to MessageList in the codebase.
2023-08-21 13:53:32 +08:00
Rankin Zheng
5eefb6b32c Refactor CurrentMessage component and ChatStore
- Updated the CurrentMessage component to use the Message model from ChatStore.
- Replaced chat.lastMessage with the last message in the chat.messages array.
- Updated the useEffect hooks to create a new Message object and pass it to the newMessage and updateLastMessage actions.
- Updated the chatPanel function in ChatPanel.tsx to create a new Message object before calling the newMessage action.
- Removed the lastMessage field from the ChatStore model.
- Updated the startResponsing action to accept a string parameter.
- Updated the updateLastMessage action to accept a string parameter and update the message field of the last message in the chat.messages array.
2023-08-18 12:11:12 +08:00
Rankin Zheng
916b45f54d Refactor async actions in ChatStore to use MobX flow
- Refactored fetchHistoryMessages and deleteMessage actions in ChatStore to use MobX flow for handling async operations.
- Updated calls to these actions in MessageHeader and ChatPanel components to handle promises returned by these actions.
2023-08-18 00:29:03 +08:00
Rankin Zheng
fcc0bf9584 Refactor ChatPanel.tsx to use MobX instead of Redux
- Replaced Redux hooks with MobX hooks for state management.
- Removed Redux actions and replaced them with equivalent MobX actions.
- Updated useEffect hook to use MobX actions instead of Redux actions.
- Replaced Redux selectors with equivalent MobX observables.
2023-08-18 00:22:16 +08:00
Rankin Zheng
fd0d0c7c94 Move ChatPanel to pages folder
- Moved ChatPanel from views to pages folder.
- Updated import paths for ChatPanel in App.tsx and MessageContainer in ChatPanel.tsx.
2023-08-03 21:58:49 +08:00