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
fe6ab1be
authored
Dec 27, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
update
parent
e1a7be9b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
store/index.ts
store/index.ts
View file @
fe6ab1be
...
@@ -15,7 +15,7 @@ import { getChatModelInfo } from "../utils/chat-info";
...
@@ -15,7 +15,7 @@ import { getChatModelInfo } from "../utils/chat-info";
import
{
ChatUserInfoService
}
from
"../utils/user-info"
;
import
{
ChatUserInfoService
}
from
"../utils/user-info"
;
import
Chat
from
"../xim"
;
import
Chat
from
"../xim"
;
import
{
Chat
as
ChatType
,
Message
}
from
"../xim/models/chat"
;
import
{
Chat
as
ChatType
,
Message
}
from
"../xim/models/chat"
;
import
xim
,
{
ChatNotifyListener
,
Xim
}
from
"../xim/xim"
;
import
xim
,
{
ChatNotifyListener
}
from
"../xim/xim"
;
import
{
decodeJwt
}
from
"uniplat-sdk"
;
import
{
decodeJwt
}
from
"uniplat-sdk"
;
import
{
ChatStatus
,
ChatStore
,
ChatStoreState
}
from
"./model"
;
import
{
ChatStatus
,
ChatStore
,
ChatStoreState
}
from
"./model"
;
...
@@ -32,7 +32,7 @@ function uniqueMessages(
...
@@ -32,7 +32,7 @@ function uniqueMessages(
messages
:
NonNullable
<
ChatStore
.
STATE_CHAT_MSG_HISTORY
>
messages
:
NonNullable
<
ChatStore
.
STATE_CHAT_MSG_HISTORY
>
)
{
)
{
const
arr
=
[...
messages
];
const
arr
=
[...
messages
];
return
unique
(
arr
,
function
(
item
,
all
)
{
return
unique
(
arr
,
function
(
item
,
all
)
{
return
all
.
findIndex
((
k
)
=>
k
.
id
===
item
.
id
);
return
all
.
findIndex
((
k
)
=>
k
.
id
===
item
.
id
);
});
});
}
}
...
@@ -366,7 +366,7 @@ export default {
...
@@ -366,7 +366,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
,
...
@@ -862,7 +862,7 @@ export default {
...
@@ -862,7 +862,7 @@ export default {
await
getChatModelInfo
(
await
getChatModelInfo
(
wantedChatRoom
.
model_name
,
wantedChatRoom
.
model_name
,
wantedChatRoom
.
obj_id
,
wantedChatRoom
.
obj_id
,
wantedChatRoom
.
detail_name
Chat
.
isBackend
()
?
wantedChatRoom
.
detail_name
:
''
)
)
.
then
((
info
)
=>
{
.
then
((
info
)
=>
{
commit
(
commit
(
...
@@ -940,7 +940,7 @@ export default {
...
@@ -940,7 +940,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
);
})
})
);
);
...
@@ -966,7 +966,7 @@ export default {
...
@@ -966,7 +966,7 @@ export default {
await
getChatModelInfo
(
await
getChatModelInfo
(
firstChat
.
model_name
,
firstChat
.
model_name
,
firstChat
.
obj_id
,
firstChat
.
obj_id
,
firstChat
.
detail_name
Chat
.
isBackend
()
?
firstChat
.
detail_name
:
''
);
);
await
dispatch
(
await
dispatch
(
ChatStore
.
ACTION_SAVE_CURRENT_CHAT_ID_VERSION
,
ChatStore
.
ACTION_SAVE_CURRENT_CHAT_ID_VERSION
,
...
@@ -1197,8 +1197,8 @@ export default {
...
@@ -1197,8 +1197,8 @@ export default {
p
.
read_count
=
option
.
all
p
.
read_count
=
option
.
all
?
p
.
total_read_count
?
p
.
total_read_count
:
option
.
readed
:
option
.
readed
?
option
.
readed
?
option
.
readed
:
p
.
read_count
+
1
;
:
p
.
read_count
+
1
;
}
}
}
}
}
else
{
}
else
{
...
@@ -1207,8 +1207,8 @@ export default {
...
@@ -1207,8 +1207,8 @@ export default {
p
.
read_count
=
option
.
all
p
.
read_count
=
option
.
all
?
p
.
total_read_count
?
p
.
total_read_count
:
option
.
readed
:
option
.
readed
?
option
.
readed
?
option
.
readed
:
p
.
read_count
+
1
;
:
p
.
read_count
+
1
;
}
}
}
}
}
}
...
...
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