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
d7ef878e
authored
Oct 14, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
ccd1ce05
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
store/index.ts
store/index.ts
View file @
d7ef878e
...
...
@@ -88,7 +88,12 @@ function buildChatItem(chat: RawChatItem) {
const
filterActiveChats
=
(
items
:
RawChatItem
[])
=>
{
return
items
.
filter
(
(
i
)
=>
!
i
.
is_finish
&&
!
i
.
is_exited
&&
!
i
.
is_remove
&&
!
i
.
is_deleted
(
i
)
=>
!
i
.
is_finish
&&
!
i
.
is_exited
&&
!
i
.
is_remove
&&
!
i
.
is_deleted
&&
i
.
type
===
"group"
);
};
...
...
@@ -376,10 +381,10 @@ export default {
list
:
cache
,
total
:
9999
,
});
const
ts
=
cache
.
map
((
i
)
=>
i
.
last_msg_ts
).
sort
();
const
ts
=
cache
.
map
((
i
)
=>
Math
.
max
(
i
.
last_msg_ts
,
i
.
update_time
))
.
sort
();
const
last
=
ts
[
ts
.
length
-
1
];
await
xim
.
fetchChatListAfter
(
last
)
!
.
then
((
r
)
=>
{
const
list
=
filterActiveChats
(
r
.
args
[
0
]
as
RawChatItem
[]);
const
items
=
list
.
map
((
i
)
=>
buildChatItem
(
i
));
...
...
@@ -387,7 +392,6 @@ export default {
cache
=
dbController
.
mergeChatList
(
cache
,
items
);
}
});
return
buildUnreadMessage
(
cache
);
}
...
...
@@ -616,7 +620,15 @@ export default {
if
(
!
data
)
{
return
;
}
const
chat
=
data
.
args
[
0
];
const
chat
=
data
.
args
[
0
]
as
RawChatItem
;
if
(
!
chat
.
model_name
&&
chat
.
business_data
)
{
const
b
=
JSON
.
parse
(
chat
.
business_data
)
as
{
model_name
:
string
;
obj_id
:
string
;
};
chat
.
model_name
=
b
.
model_name
;
chat
.
obj_id
=
b
.
obj_id
;
}
wantedChatRoom
=
{
...
chat
,
chat_id
:
chat
.
id
,
...
...
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