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
875bffc1
authored
Oct 21, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
cs
parent
e5a7e365
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
store/index.ts
xim/index.ts
store/index.ts
View file @
875bffc1
...
...
@@ -31,7 +31,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
);
});
}
...
...
@@ -108,7 +108,7 @@ export function getLastMessageId(msgs: Message[] | any) {
const
last
=
msgs
[
msgs
.
length
-
1
];
let
id
=
last
.
id
;
if
(
id
<
0
)
{
id
=
Math
.
max
(...
msgs
.
map
((
i
)
=>
i
.
id
));
id
=
Math
.
max
(...
msgs
.
map
((
i
:
any
)
=>
i
.
id
));
}
return
id
;
}
...
...
@@ -326,7 +326,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
,
...
...
@@ -729,7 +729,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
);
})
);
...
...
xim/index.ts
View file @
875bffc1
...
...
@@ -67,11 +67,14 @@ class Chat {
}
private
setupIndexDb
()
{
return
dbController
.
setup
(
this
.
_sdk
().
global
.
uid
+
if
(
this
.
_sdk
)
{
const
s
=
this
.
_sdk
();
return
dbController
.
setup
(
s
.
global
.
uid
+
"-"
+
(
this
.
_sdk
().
global
.
initData
.
orgId
||
0
)
);
(
s
.
global
.
initData
.
orgId
||
0
)
);
}
}
public
resetup
(
org
:
()
=>
string
|
number
)
{
...
...
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