File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
packages/playground/website/src/components/ensure-playground-site Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 88 setTemporarySiteSpec ,
99} from '../../lib/state/redux/slice-sites' ;
1010import {
11+ selectActiveSite ,
1112 setActiveSite ,
1213 useAppDispatch ,
1314 useAppSelector ,
@@ -33,6 +34,7 @@ export function EnsurePlaygroundSiteIsSelected({
3334 const siteListingStatus = useAppSelector (
3435 ( state ) => state . sites . loadingState
3536 ) ;
37+ const activeSite = useAppSelector ( ( state ) => selectActiveSite ( state ) ) ;
3638 const dispatch = useAppDispatch ( ) ;
3739 const url = useCurrentUrl ( ) ;
3840 const requestedSiteSlug = url . searchParams . get ( 'site-slug' ) ;
@@ -90,7 +92,9 @@ export function EnsurePlaygroundSiteIsSelected({
9092 const newParams = new URLSearchParams ( url ?. search ) ;
9193 oldParams . delete ( notRefreshingParam ) ;
9294 newParams . delete ( notRefreshingParam ) ;
93- if ( oldParams . toString ( ) === newParams . toString ( ) ) {
95+ const avoidUnnecessaryTempSiteReload =
96+ activeSite && oldParams . toString ( ) === newParams . toString ( ) ;
97+ if ( avoidUnnecessaryTempSiteReload ) {
9498 return ;
9599 }
96100
You can’t perform that action at this time.
0 commit comments