mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 10:23:04 -05:00
8ca159b4b9
PDF Detach GitOrigin-RevId: f69d8a87d1ba2115ad496a719106dfc7707a6ed5
11 lines
288 B
JavaScript
11 lines
288 B
JavaScript
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
|
|
}
|