File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed 
packages/svelte/src/internal/client Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,8 @@ export class Boundary {
228228				} ) ; 
229229			} 
230230
231+ 			this . ran  =  false ; 
232+ 
231233			this . #main_effect =  this . #run( ( )  =>  { 
232234				this . #is_creating_fallback =  false ; 
233235
@@ -238,6 +240,8 @@ export class Boundary {
238240				} 
239241			} ) ; 
240242
243+ 			this . ran  =  true ; 
244+ 
241245			if  ( this . #pending_count >  0 )  { 
242246				this . #show_pending_snippet( ) ; 
243247			} 
Original file line number Diff line number Diff line change @@ -124,13 +124,13 @@ export function async_derived(fn, location) {
124124		var  restore  =  capture ( ) ; 
125125
126126		var  fork  =  active_fork ; 
127+ 		var  ran  =  boundary . ran ; 
127128
128129		if  ( should_suspend )  { 
129- 			if  ( fork  !==  null )  { 
130- 				fork . increment ( ) ; 
131- 			}  else  { 
132- 				// if nearest pending boundary is not ready, attach to the boundary 
130+ 			if  ( ! ran )  { 
133131				boundary . increment ( ) ; 
132+ 			}  else  { 
133+ 				fork ?. increment ( ) ; 
134134			} 
135135		} 
136136
@@ -144,10 +144,10 @@ export function async_derived(fn, location) {
144144				from_async_derived  =  null ; 
145145
146146				if  ( should_suspend )  { 
147- 					if  ( fork  !==  null )  { 
148- 						fork . decrement ( ) ; 
149- 					}  else  { 
147+ 					if  ( ! ran )  { 
150148						boundary . decrement ( ) ; 
149+ 					}  else  { 
150+ 						fork ?. decrement ( ) ; 
151151					} 
152152				} 
153153
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments