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
7089483d
authored
Sep 30, 2021
by
Sixong.Zhu
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
catch
parent
8532b10e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
store/index.ts
store/index.ts
View file @
7089483d
...
@@ -28,7 +28,7 @@ function uniqueMessages(
...
@@ -28,7 +28,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
);
});
});
}
}
...
@@ -301,7 +301,7 @@ export default {
...
@@ -301,7 +301,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
,
...
@@ -633,22 +633,24 @@ export default {
...
@@ -633,22 +633,24 @@ export default {
commit
(
ChatStore
.
MUTATION_SET_CURRENT_USER_UID
,
userInfo
.
id
);
commit
(
ChatStore
.
MUTATION_SET_CURRENT_USER_UID
,
userInfo
.
id
);
}
}
const
info
=
await
getChatModelInfo
(
commit
(
ChatStore
.
MUTATION_CLEAR_CHAT_MSG_HISTORY
);
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_ID
,
chatId
);
await
getChatModelInfo
(
wantedChatRoom
.
business_data
.
model_name
,
wantedChatRoom
.
business_data
.
model_name
,
wantedChatRoom
.
business_data
.
obj_id
,
wantedChatRoom
.
business_data
.
obj_id
,
wantedChatRoom
.
business_data
.
detail_name
wantedChatRoom
.
business_data
.
detail_name
);
).
then
(
info
=>
{
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_VERSION
,
info
.
uniplat_version
);
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_UNIPLAT_ID
,
info
.
uniplatId
);
}).
catch
(
console
.
error
)
commit
(
ChatStore
.
MUTATION_CLEAR_CHAT_MSG_HISTORY
);
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_ID
,
chatId
);
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_VERSION
,
info
.
uniplat_version
);
commit
(
ChatStore
.
MUTATION_SAVE_CURRENT_CHAT_UNIPLAT_ID
,
info
.
uniplatId
);
commit
(
ChatStore
.
MUTATION_INITING_CHAT
);
commit
(
ChatStore
.
MUTATION_INITING_CHAT
);
removeRegisterChatEvents
.
forEach
((
k
)
=>
k
());
removeRegisterChatEvents
.
forEach
((
k
)
=>
k
());
await
dispatch
(
ChatStore
.
ACTION_GET_CHAT_MEMBERS
);
await
dispatch
(
ChatStore
.
ACTION_GET_CHAT_MEMBERS
);
...
@@ -708,7 +710,7 @@ export default {
...
@@ -708,7 +710,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