File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -50,14 +50,14 @@ jobs:
5050 // Find the subroute root from the current URL. Just the pattern components/pr-preview/pr-<PR_NUMBER>
5151 const parts = window.location.pathname.split('/');
5252 let realUrl;
53- if (parts[1 ] === 'pr-preview') ) {
54- realUrl = '/' + parts.slice(0 , 4).join('/') + '/';
53+ if (parts[2 ] === 'pr-preview') {
54+ realUrl = '/' + parts.slice(1 , 4).join('/') + '/';
5555 } else {
5656 // If not a PR preview, redirect to the main page
57- realUrl = parts.slice(0 , 4);
57+ realUrl = '/' + parts.slice(1 , 4).join('/' );
5858 }
5959 // Manually fetch the index.html file from the correct subroute
60- fetch(realUrl + 'index.html' )
60+ fetch(realUrl)
6161 .then(response => {
6262 if (!response.ok) {
6363 throw new Error('Network response was not ok');
Original file line number Diff line number Diff line change @@ -61,14 +61,14 @@ jobs:
6161 // Find the subroute root from the current URL. Just the pattern components/pr-preview/pr-<PR_NUMBER>
6262 const parts = window.location.pathname.split('/');
6363 let realUrl;
64- if (parts[1 ] === 'pr-preview') ) {
65- realUrl = '/' + parts.slice(0 , 4).join('/') + '/';
64+ if (parts[2 ] === 'pr-preview') {
65+ realUrl = '/' + parts.slice(1 , 4).join('/') + '/';
6666 } else {
6767 // If not a PR preview, redirect to the main page
68- realUrl = parts.slice(0 , 4);
68+ realUrl = '/' + parts.slice(1 , 4).join('/' );
6969 }
7070 // Manually fetch the index.html file from the correct subroute
71- fetch(realUrl + 'index.html' )
71+ fetch(realUrl)
7272 .then(response => {
7373 if (!response.ok) {
7474 throw new Error('Network response was not ok');
You can’t perform that action at this time.
0 commit comments