Skip to content

Commit

Permalink
fix: fixed baseHref slice function to include workspace href
Browse files Browse the repository at this point in the history
  • Loading branch information
markuczy committed Jul 1, 2024
1 parent 989ba94 commit 8322b12
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ export function sliceBaseHref(route: Route, url: UrlSegment[]): UrlSegment[] {
'mfeInfo was not provided for route. initializeRouter function is required to be registered as app initializer.'
)
}
const baseHrefSegmentAmount = mfeBaseHref.split('/').filter((value) => value).length

const fullUrl = '/' + url.map((u) => u).join('/') + '/'
const mfeBaseHrefStartindex = fullUrl.indexOf(mfeBaseHref)
const baseHrefSegmentAmount = fullUrl
.slice(0, mfeBaseHrefStartindex + mfeBaseHref.length)
.split('/')
.filter((value) => value).length
return url.slice(baseHrefSegmentAmount)
}

Expand Down

0 comments on commit 8322b12

Please sign in to comment.