Merge pull request #5797 from overleaf/ta-pdf-detach

PDF Detach

GitOrigin-RevId: f69d8a87d1ba2115ad496a719106dfc7707a6ed5
This commit is contained in:
Timothée Alby
2021-11-16 09:02:57 +00:00
committed by Copybot
parent c73894e56b
commit 8ca159b4b9
32 changed files with 762 additions and 147 deletions
@@ -0,0 +1,11 @@
export function buildUrlWithDetachRole(mode) {
const url = new URL(window.location)
const cleanPathname = url.pathname
.replace(/\/(detached|detacher)\/?$/, '')
.replace(/\/$/, '')
url.pathname = cleanPathname
if (mode) {
url.pathname += `/${mode}`
}
return url
}