File tree Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Expand file tree Collapse file tree 3 files changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -565,7 +565,7 @@ export const ModalRoot = ({ children }) => {
565565 console . error ( 'No base url in modal response data so cannot navigate back' )
566566 return
567567 }
568- if ( ! isNavigating && window . location . href !== modalOnBase . baseUrl ) {
568+ if ( ! isNavigating && typeof window !== 'undefined' && window . location . href !== modalOnBase . baseUrl ) {
569569 router . visit ( modalOnBase . baseUrl , {
570570 preserveScroll : true ,
571571 preserveState : true ,
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ onUnmounted(
3636 return
3737 }
3838
39- if (! isNavigating && window .location .href !== modalOnBase .baseUrl ) {
39+ if (! isNavigating && typeof window !== ' undefined ' && window .location .href !== modalOnBase .baseUrl ) {
4040 router .visit (modalOnBase .baseUrl , {
4141 preserveScroll: true ,
4242 preserveState: true ,
Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ function generateIdUsing(callback) {
55}
66
77function sameUrlPath ( url1 , url2 ) {
8- url1 = typeof url1 === 'string' ? new URL ( url1 , window . location . origin ) : url1
9- url2 = typeof url2 === 'string' ? new URL ( url2 , window . location . origin ) : url2
8+ const origin = typeof window !== 'undefined' ? window . location . origin : 'http://localhost'
9+ url1 = typeof url1 === 'string' ? new URL ( url1 , origin ) : url1
10+ url2 = typeof url2 === 'string' ? new URL ( url2 , origin ) : url2
1011
1112 return `${ url1 . origin } ${ url1 . pathname } ` === `${ url2 . origin } ${ url2 . pathname } `
1213}
You can’t perform that action at this time.
0 commit comments