Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
foreign
/
customer-service
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
d3bccd6e
authored
Oct 14, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Plain Diff
merge
parents
f129063c
df8dd2b9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
9 deletions
store/index.ts
xim/xim.ts
store/index.ts
View file @
d3bccd6e
...
...
@@ -33,7 +33,7 @@ function uniqueMessages(
messages
:
NonNullable
<
ChatStore
.
STATE_CHAT_MSG_HISTORY
>
)
{
const
arr
=
[...
messages
];
return
unique
(
arr
,
function
(
item
,
all
)
{
return
unique
(
arr
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
id
===
item
.
id
);
});
}
...
...
@@ -317,7 +317,7 @@ export default {
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
}
=
{};
return
(
state
:
ChatStoreState
,
...
...
@@ -721,7 +721,7 @@ export default {
}
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_MEMBERS
,
unique
(
newChatMembers
,
function
(
item
,
all
)
{
unique
(
newChatMembers
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
eid
===
item
.
eid
);
})
);
...
...
@@ -883,12 +883,7 @@ export default {
},
getters
:
{
[
ChatStore
.
STATE_CHAT_MSG_HISTORY
](
state
)
{
// 过滤消息撤回
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
));
return
state
[
ChatStore
.
STATE_CHAT_MSG_HISTORY
]
??
[];
},
[
ChatStore
.
STATE_CHAT_SENDING_MESSAGES
](
state
)
{
return
state
[
ChatStore
.
STATE_CHAT_SENDING_MESSAGES
]
||
[];
...
...
xim/xim.ts
View file @
d3bccd6e
...
...
@@ -320,6 +320,10 @@ export class Xim {
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
]
{
if
(
args
.
length
<
2
)
{
throw
new
Error
(
"参数个数不正确"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment