Merge pull request #6053 from overleaf/ta-pdf-detach-tests

PDF Detach Misc Tests

GitOrigin-RevId: 9615c8fdfd8964a9c63d7c91e4596d397a1d35dc
This commit is contained in:
Timothée Alby
2021-12-15 09:04:46 +00:00
committed by Copybot
parent 1201a733d9
commit 44eca312ff
16 changed files with 817 additions and 28 deletions
@@ -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
}