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
2951b826
authored
Jan 11, 2022
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'pre' into release
parents
c43e70d0
4c59e85e
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
10 deletions
components/message.vue
store/index.ts
components/message.vue
View file @
2951b826
...
@@ -155,7 +155,6 @@
...
@@ -155,7 +155,6 @@
import
avatar
from
"@/customer-service/components/avatar.vue"
;
import
avatar
from
"@/customer-service/components/avatar.vue"
;
import
{
chatStore
,
ChatStore
}
from
"@/customer-service/store/model"
;
import
{
chatStore
,
ChatStore
}
from
"@/customer-service/store/model"
;
import
ximInstance
from
"../xim/xim"
;
import
ximInstance
from
"../xim/xim"
;
import
{
dbController
}
from
"../database"
;
import
ImageMessage
from
"./message-item/image-message.vue"
;
import
ImageMessage
from
"./message-item/image-message.vue"
;
import
FileMessage
from
"./message-item/file-message.vue"
;
import
FileMessage
from
"./message-item/file-message.vue"
;
import
AudioMessage
from
"./message-item/audio-message.vue"
;
import
AudioMessage
from
"./message-item/audio-message.vue"
;
...
...
store/index.ts
View file @
2951b826
...
@@ -376,7 +376,7 @@ export default {
...
@@ -376,7 +376,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
,
...
@@ -470,15 +470,10 @@ export default {
...
@@ -470,15 +470,10 @@ export default {
}
}
if
(
cache
&&
cache
.
length
)
{
if
(
cache
&&
cache
.
length
)
{
commit
(
ChatStore
.
MUTATION_SAVE_CHAT_LIST
,
cache
);
const
ts
=
cache
.
map
((
i
)
=>
Math
.
max
(
i
.
last_msg_ts
,
i
.
update_time
))
.
sort
();
const
last
=
ts
[
ts
.
length
-
1
];
const
execute
=
()
=>
const
execute
=
()
=>
new
Promise
<
ChatType
[]
>
((
resolve
,
reject
)
=>
{
new
Promise
<
ChatType
[]
>
((
resolve
,
reject
)
=>
{
Chat
.
onReady
(()
=>
{
Chat
.
onReady
(()
=>
{
xim
.
fetchChatListAfter
(
last
)
!
xim
.
fetchChatListAfter
(
0
)
.
then
((
r
)
=>
{
.
then
((
r
)
=>
{
const
list
=
filterActiveChats
(
const
list
=
filterActiveChats
(
r
.
args
[
0
]
as
RawChatItem
[]
r
.
args
[
0
]
as
RawChatItem
[]
...
@@ -495,6 +490,10 @@ export default {
...
@@ -495,6 +490,10 @@ export default {
dispatch
(
dispatch
(
ChatStore
.
ACTION_REBUILD_UNREAD_MESSAGE_COUNT
ChatStore
.
ACTION_REBUILD_UNREAD_MESSAGE_COUNT
).
finally
(
resolve
);
).
finally
(
resolve
);
commit
(
ChatStore
.
MUTATION_SAVE_CHAT_LIST
,
cache
);
})
})
.
catch
(
reject
);
.
catch
(
reject
);
});
});
...
@@ -781,7 +780,8 @@ export default {
...
@@ -781,7 +780,8 @@ export default {
if
(
if
(
e
.
type
===
MessageType
.
Withdraw
&&
e
.
type
===
MessageType
.
Withdraw
&&
// 这里再取一次当前chatId避免数据和当前不一致
// 这里再取一次当前chatId避免数据和当前不一致
e
.
chat_id
===
state
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
]
e
.
chat_id
===
state
[
ChatStore
.
STATE_CHAT_CURRENT_CHAT_ID
]
)
{
)
{
commit
(
commit
(
ChatStore
.
MUTATION_WITHDRAW
,
ChatStore
.
MUTATION_WITHDRAW
,
...
@@ -993,7 +993,7 @@ export default {
...
@@ -993,7 +993,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
);
})
})
);
);
...
...
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