File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 66 * Captured once so it doesn't drift as client-side nav happens.
77 */
88 const firstSegment = window . location . pathname . split ( '/' ) . filter ( Boolean ) [ 0 ] ;
9- const PRODUCT_BASE = firstSegment ? `/${ firstSegment } /` : '/' ;
9+ const PRODUCT_BASE = firstSegment ? `/${ firstSegment } /` : null ;
1010
1111 function isExternalToProduct ( rawUrl ) {
1212 let url ;
1919 // Ignore different origins — browser handles those natively
2020 if ( url . origin !== window . location . origin ) return false ;
2121
22+ // At root (no product prefix), any navigation into a product sub-path is cross-product
23+ if ( ! PRODUCT_BASE ) {
24+ return url . pathname . split ( '/' ) . filter ( Boolean ) . length > 0 ;
25+ }
26+
2227 // Force hard load if the path leaves the current product base
2328 return ! url . pathname . startsWith ( PRODUCT_BASE ) ;
2429 }
You can’t perform that action at this time.
0 commit comments