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
609951c8
authored
Oct 14, 2021
by
杨铁龙
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge commit '
d7ef878e
' into ytl003
parents
723eb400
d7ef878e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
6 deletions
store/index.ts
store/index.ts
View file @
609951c8
...
...
@@ -90,7 +90,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"
);
};
...
...
@@ -378,10 +383,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
));
...
...
@@ -389,7 +394,6 @@ export default {
cache
=
dbController
.
mergeChatList
(
cache
,
items
);
}
});
return
buildUnreadMessage
(
cache
);
}
...
...
@@ -617,7 +621,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