Commit d3bccd6e by Sixong.Zhu

merge

parents f129063c df8dd2b9
Showing with 8 additions and 9 deletions
...@@ -33,7 +33,7 @@ function uniqueMessages( ...@@ -33,7 +33,7 @@ function uniqueMessages(
messages: NonNullable<ChatStore.STATE_CHAT_MSG_HISTORY> messages: NonNullable<ChatStore.STATE_CHAT_MSG_HISTORY>
) { ) {
const arr = [...messages]; const arr = [...messages];
return unique(arr, function (item, all) { return unique(arr, function(item, all) {
return all.findIndex((k) => k.id === item.id); return all.findIndex((k) => k.id === item.id);
}); });
} }
...@@ -317,7 +317,7 @@ export default { ...@@ -317,7 +317,7 @@ export default {
state[ChatStore.STATE_CHAT_SENDING_MESSAGES] = [...current]; state[ChatStore.STATE_CHAT_SENDING_MESSAGES] = [...current];
} }
}, },
[ChatStore.MUTATION_SAVE_CURRENT_CHAT_INPUTING]: (function () { [ChatStore.MUTATION_SAVE_CURRENT_CHAT_INPUTING]: (function() {
const setTimeoutId: { [key: string]: number } = {}; const setTimeoutId: { [key: string]: number } = {};
return ( return (
state: ChatStoreState, state: ChatStoreState,
...@@ -721,7 +721,7 @@ export default { ...@@ -721,7 +721,7 @@ export default {
} }
commit( commit(
ChatStore.MUTATION_SAVE_CURRENT_CHAT_MEMBERS, ChatStore.MUTATION_SAVE_CURRENT_CHAT_MEMBERS,
unique(newChatMembers, function (item, all) { unique(newChatMembers, function(item, all) {
return all.findIndex((k) => k.eid === item.eid); return all.findIndex((k) => k.eid === item.eid);
}) })
); );
...@@ -883,12 +883,7 @@ export default { ...@@ -883,12 +883,7 @@ export default {
}, },
getters: { getters: {
[ChatStore.STATE_CHAT_MSG_HISTORY](state) { [ChatStore.STATE_CHAT_MSG_HISTORY](state) {
// 过滤消息撤回 return state[ChatStore.STATE_CHAT_MSG_HISTORY] ?? [];
const msgList = state[ChatStore.STATE_CHAT_MSG_HISTORY] ?? [];
const drawList = msgList
.filter((i) => i.type === MessageType.Withdraw)
.map((i) => +i.msg);
return msgList.filter((i) => !drawList.includes(i.id));
}, },
[ChatStore.STATE_CHAT_SENDING_MESSAGES](state) { [ChatStore.STATE_CHAT_SENDING_MESSAGES](state) {
return state[ChatStore.STATE_CHAT_SENDING_MESSAGES] || []; return state[ChatStore.STATE_CHAT_SENDING_MESSAGES] || [];
......
...@@ -320,6 +320,10 @@ export class Xim { ...@@ -320,6 +320,10 @@ export class Xim {
return this.client?.syncReadMsg(chatId, start_msg_id, end_msg_id); return this.client?.syncReadMsg(chatId, start_msg_id, end_msg_id);
} }
public setUnRead(chatId: number) {
return this.client?.unreadChat(chatId);
}
private parseEventListener(...args: any[]): [string, Function] { private parseEventListener(...args: any[]): [string, Function] {
if (args.length < 2) { if (args.length < 2) {
throw new Error("参数个数不正确"); throw new Error("参数个数不正确");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment