fix(runtime-core/scheduler): prevent duplicate queue (#1767)

This commit is contained in:
Yang Mingshan
2020-08-04 05:19:06 +08:00
committed by GitHub
parent 86cdf6694d
commit b2a91429ed
2 changed files with 13 additions and 1 deletions

View File

@@ -45,7 +45,7 @@ export function queueJob(job: SchedulerJob) {
// ensure it doesn't end up in an infinite loop.
if (
!queue.length ||
!queue.includes(job, job.cb ? flushIndex + 1 : flushIndex)
!queue.includes(job, isFlushing && job.cb ? flushIndex + 1 : flushIndex)
) {
queue.push(job)
if ((job.id as number) < 0) hasPendingPreFlushJobs = true