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 1
1
import { run_all , Queue } from './utils' ;
2
- import { set_current_component } from './lifecycle' ;
2
+ import { get_current_component , set_current_component } from './lifecycle' ;
3
3
4
4
export const dirty_components = new Queue < any > ( ) ;
5
5
export const intros = { enabled : false } ;
@@ -34,6 +34,11 @@ export function add_flush_callback(fn) {
34
34
const seen_callbacks = new Set ( ) ;
35
35
export function flush ( ) {
36
36
37
+ let current_component = null ;
38
+ try {
39
+ current_component = get_current_component ( )
40
+ } catch { }
41
+
37
42
do {
38
43
// first, call beforeUpdate functions
39
44
// and update components
@@ -65,6 +70,8 @@ export function flush() {
65
70
render_callbacks . length = 0 ;
66
71
} while ( dirty_components . length ) ;
67
72
73
+ set_current_component ( current_component ) ;
74
+
68
75
while ( flush_callbacks . length ) {
69
76
flush_callbacks . pop ( ) ( ) ;
70
77
}
You can’t perform that action at this time.
0 commit comments