fix(runtime-core/scheduler): prevent duplicate queue (#1767)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user