File tree Expand file tree Collapse file tree 1 file changed +17
-17
lines changed
src/Components/Components/src/Routing Expand file tree Collapse file tree 1 file changed +17
-17
lines changed Original file line number Diff line number Diff line change @@ -276,22 +276,7 @@ internal virtual void Refresh(bool isNavigationIntercepted)
276276 // We did not find a Component that matches the route.
277277 // Only show the NotFound content if the application developer programatically got us here i.e we did not
278278 // intercept the navigation. In all other cases, force a browser navigation since this could be non-Blazor content.
279- _renderHandle . Render ( builder =>
280- {
281- if ( NotFoundPage != null )
282- {
283- builder . OpenComponent ( 0 , NotFoundPage ) ;
284- builder . CloseComponent ( ) ;
285- }
286- else if ( NotFound != null )
287- {
288- NotFound ( builder ) ;
289- }
290- else
291- {
292- DefaultNotFoundContent ( builder ) ;
293- }
294- } ) ;
279+ _renderHandle . Render ( NotFound ?? DefaultNotFoundContent ) ;
295280 }
296281 else
297282 {
@@ -367,7 +352,22 @@ private void OnNotFound(object sender, EventArgs args)
367352 if ( _renderHandle . IsInitialized )
368353 {
369354 Log . DisplayingNotFound ( _logger ) ;
370- _renderHandle . Render ( NotFound ?? DefaultNotFoundContent ) ;
355+ _renderHandle . Render ( builder =>
356+ {
357+ if ( NotFoundPage != null )
358+ {
359+ builder . OpenComponent ( 0 , NotFoundPage ) ;
360+ builder . CloseComponent ( ) ;
361+ }
362+ else if ( NotFound != null )
363+ {
364+ NotFound ( builder ) ;
365+ }
366+ else
367+ {
368+ DefaultNotFoundContent ( builder ) ;
369+ }
370+ } ) ;
371371 }
372372 }
373373
You can’t perform that action at this time.
0 commit comments