Brought back a guard to prevent calling flush() while flush is running

pull/7722/head
YIFAN WU 4 years ago
parent 52f5005cfd
commit 57fb06ee02
No known key found for this signature in database
GPG Key ID: 0E94BC0683AFCE47

@ -51,7 +51,10 @@ export function add_flush_callback(fn) {
// function, guarantees this behavior.
const seen_callbacks = new Set();
let flushidx = 0; // Do *not* move this inside the flush() function
let flushing = false;
export function flush() {
if (flushing) return;
flushing = true;
const saved_component = current_component;
do {
@ -90,7 +93,8 @@ export function flush() {
while (flush_callbacks.length) {
flush_callbacks.pop()();
}
flushing = false;
update_scheduled = false;
seen_callbacks.clear();
set_current_component(saved_component);

Loading…
Cancel
Save