File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11import { run_all , Queue } from './utils' ;
2- import { set_current_component } from './lifecycle' ;
2+ import { get_current_component , set_current_component } from './lifecycle' ;
33
44export const dirty_components = new Queue < any > ( ) ;
55export const intros = { enabled : false } ;
@@ -34,6 +34,11 @@ export function add_flush_callback(fn) {
3434const seen_callbacks = new Set ( ) ;
3535export function flush ( ) {
3636
37+ let current_component = null ;
38+ try {
39+ current_component = get_current_component ( )
40+ } catch { }
41+
3742 do {
3843 // first, call beforeUpdate functions
3944 // and update components
@@ -65,6 +70,8 @@ export function flush() {
6570 render_callbacks . length = 0 ;
6671 } while ( dirty_components . length ) ;
6772
73+ set_current_component ( current_component ) ;
74+
6875 while ( flush_callbacks . length ) {
6976 flush_callbacks . pop ( ) ( ) ;
7077 }
You can’t perform that action at this time.
0 commit comments