Merge pull request #6053 from overleaf/ta-pdf-detach-tests
PDF Detach Misc Tests GitOrigin-RevId: 9615c8fdfd8964a9c63d7c91e4596d397a1d35dc
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
export function buildUrlWithDetachRole(mode) {
|
||||
const url = new URL(window.location)
|
||||
const cleanPathname = url.pathname
|
||||
let cleanPathname = url.pathname
|
||||
.replace(/\/(detached|detacher)\/?$/, '')
|
||||
.replace(/\/$/, '')
|
||||
url.pathname = cleanPathname
|
||||
if (mode) {
|
||||
url.pathname += `/${mode}`
|
||||
cleanPathname += `/${mode}`
|
||||
}
|
||||
url.pathname = cleanPathname
|
||||
return url
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user