撤回消息实现
This commit is contained in:
@@ -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 }) {
|
||||
|
||||
Reference in New Issue
Block a user