Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fns_front_2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenqikuai
fns_front_2
Commits
d87adbfd
Commit
d87adbfd
authored
Oct 14, 2021
by
chenqikuai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复handleEveryReceive函数在极短时间内多次调用会出现消息列表重复展示的问题
parent
a5ccf151
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
ChatDBService.ts
src/db/ChatDBService.ts
+5
-2
No files found.
src/db/ChatDBService.ts
View file @
d87adbfd
...
@@ -27,17 +27,20 @@ export default class ChatDBService {
...
@@ -27,17 +27,20 @@ export default class ChatDBService {
isRoboot
?:
boolean
isRoboot
?:
boolean
})
{
})
{
let
firstInsert
=
false
let
firstInsert
=
false
if
(
this
.
dataList
.
length
===
0
)
{
const
isQueueEmpty
=
this
.
dataList
.
length
===
0
if
(
isQueueEmpty
)
{
firstInsert
=
true
firstInsert
=
true
}
}
this
.
pushToList
(
data
)
this
.
pushToList
(
data
)
if
(
firstInsert
===
true
)
{
if
(
firstInsert
===
true
)
{
await
this
.
exec
(
this
.
dataList
[
0
])
this
.
dataList
.
shift
()
this
.
startExecList
()
this
.
startExecList
()
}
}
}
}
private
async
startExecList
():
Promise
<
any
>
{
private
async
startExecList
():
Promise
<
any
>
{
if
(
this
.
dataList
[
0
]
!==
undefined
)
{
if
(
this
.
dataList
.
length
!==
0
)
{
const
msg
=
this
.
dataList
[
0
]
const
msg
=
this
.
dataList
[
0
]
await
this
.
exec
(
msg
)
await
this
.
exec
(
msg
)
this
.
dataList
.
shift
()
this
.
dataList
.
shift
()
...
...
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