fix: attempt to reduce page flicker
This commit is contained in:
parent
c85892d6cd
commit
e9eb897f36
1 changed files with 5 additions and 0 deletions
|
|
@ -186,6 +186,7 @@ class ClientService extends EventTarget {
|
|||
) {
|
||||
const newEventIdSet = new Set<string>()
|
||||
const requestCount = subRequests.length
|
||||
const threshold = Math.ceil(requestCount / 2)
|
||||
let eventIdSet = new Set<string>()
|
||||
let events: NEvent[] = []
|
||||
let eosedCount = 0
|
||||
|
|
@ -200,6 +201,10 @@ class ClientService extends EventTarget {
|
|||
if (_eosed) {
|
||||
eosedCount++
|
||||
}
|
||||
if (eosedCount < threshold) {
|
||||
return
|
||||
}
|
||||
|
||||
_events.forEach((evt) => {
|
||||
if (eventIdSet.has(evt.id)) return
|
||||
eventIdSet.add(evt.id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue