mirror of
https://github.com/sqlchat/sqlchat.git
synced 2025-07-29 10:13:14 +08:00
* fix the change assistant didn't take effect immediately #45 * Update src/store/conversation.ts Co-authored-by: boojack <stevenlgtm@gmail.com> * change method name * change method name * fix the call method --------- Co-authored-by: boojack <stevenlgtm@gmail.com>
This commit is contained in:
@ -32,7 +32,7 @@ const ConversationView = () => {
|
||||
const [isStickyAtBottom, setIsStickyAtBottom] = useState<boolean>(true);
|
||||
const [showHeaderShadow, setShowHeaderShadow] = useState<boolean>(false);
|
||||
const conversationViewRef = useRef<HTMLDivElement>(null);
|
||||
const currentConversation = conversationStore.currentConversation;
|
||||
const currentConversation = conversationStore.getConversationById(conversationStore.currentConversationId);
|
||||
const messageList = messageStore.messageList.filter((message) => message.conversationId === currentConversation?.id);
|
||||
const lastMessage = last(messageList);
|
||||
|
||||
@ -99,11 +99,10 @@ const ConversationView = () => {
|
||||
conversation.connectionId === connectionStore.currentConnectionCtx?.connection.id &&
|
||||
conversation.databaseName === connectionStore.currentConnectionCtx?.database?.name
|
||||
);
|
||||
conversationStore.setCurrentConversation(head(conversationList));
|
||||
conversationStore.setCurrentConversationId(head(conversationList)?.id);
|
||||
}, [currentConversation, connectionStore.currentConnectionCtx]);
|
||||
|
||||
const sendMessageToCurrentConversation = async () => {
|
||||
const currentConversation = conversationStore.getState().currentConversation;
|
||||
if (!currentConversation) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user