mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-15 06:33:55 +01:00
Merge pull request #5797 from overleaf/ta-pdf-detach
PDF Detach GitOrigin-RevId: f69d8a87d1ba2115ad496a719106dfc7707a6ed5
This commit is contained in:
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user