修复了修改消息时可能修改到错误消息的问题

This commit is contained in:
cc
2026-02-18 23:18:14 +08:00
parent 21ea879d97
commit 84ea378815
9 changed files with 15 additions and 15 deletions

View File

@@ -1658,7 +1658,7 @@ function ChatPage(_props: ChatPageProps) {
}
try {
const result = await (window as any).electronAPI.chat.updateMessage(currentSessionId, editingMessage.message.localId, finalContent)
const result = await (window as any).electronAPI.chat.updateMessage(currentSessionId, editingMessage.message.localId, editingMessage.message.createTime, finalContent)
if (result.success) {
const currentMessages = useChatStore.getState().messages
const newMessages = currentMessages.map(m => {

View File

@@ -85,7 +85,7 @@ export interface ElectronAPI {
}>
getContact: (username: string) => Promise<Contact | null>
getContactAvatar: (username: string) => Promise<{ avatarUrl?: string; displayName?: string } | null>
updateMessage: (sessionId: string, localId: number, newContent: string) => Promise<{ success: boolean; error?: string }>
updateMessage: (sessionId: string, localId: number, createTime: number, newContent: string) => Promise<{ success: boolean; error?: string }>
deleteMessage: (sessionId: string, localId: number, createTime: number, dbPathHint?: string) => Promise<{ success: boolean; error?: string }>
resolveTransferDisplayNames: (chatroomId: string, payerUsername: string, receiverUsername: string) => Promise<{ payerName: string; receiverName: string }>
getContacts: () => Promise<{