fix(runtime-core): fix scheduler dedupe when not flushing

This commit is contained in:
Evan You 2020-07-28 13:23:09 -04:00
parent c27dfe1d09
commit 4ef5c8d424

View File

@ -13,7 +13,7 @@ let currentFlushPromise: Promise<void> | null = null
let isFlushing = false let isFlushing = false
let isFlushPending = false let isFlushPending = false
let flushIndex = 0 let flushIndex = -1
let pendingPostFlushCbs: Function[] | null = null let pendingPostFlushCbs: Function[] | null = null
let pendingPostFlushIndex = 0 let pendingPostFlushIndex = 0
@ -114,7 +114,7 @@ function flushJobs(seen?: CountMap) {
callWithErrorHandling(job, null, ErrorCodes.SCHEDULER) callWithErrorHandling(job, null, ErrorCodes.SCHEDULER)
} }
} }
flushIndex = 0 flushIndex = -1
queue.length = 0 queue.length = 0
flushPostFlushCbs(seen) flushPostFlushCbs(seen)