撤回消息实现

This commit is contained in:
砂糖
2025-07-14 11:04:49 +08:00
parent fc8741c0c1
commit af7ef14ba2
5 changed files with 397 additions and 75 deletions

View File

@@ -55,10 +55,11 @@ const actions = {
isSuccess = false,
},
) {
const tmpList = state.historyMessageList;
const tmpList = [...state.historyMessageList];
const idx = tmpList.findIndex(
(msg) => msg.clientMsgID === message.clientMsgID,
);
console.log('updateOneMessage:', { message, idx, listLength: tmpList.length });
if (idx !== -1) {
if (type === UpdateMessageTypes.Overall) {
tmpList[idx] = {
@@ -71,6 +72,9 @@ const actions = {
);
}
commit("SET_HISTORY_MESSAGE_LIST", tmpList);
console.log('消息更新成功,新的消息内容:', tmpList[idx]);
} else {
console.log('未找到要更新的消息:', message.clientMsgID);
}
},
resetMessageState({ commit }) {