mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 17:56:30 -05:00
Fix bug that pathname is always empty (#859)
This commit is contained in:
parent
0c0841639a
commit
c5ad0e6eca
1 changed files with 3 additions and 1 deletions
|
@ -8,6 +8,8 @@ import { useLocation } from 'react-router'
|
||||||
|
|
||||||
export const useFrontendBaseUrl = (): string => {
|
export const useFrontendBaseUrl = (): string => {
|
||||||
const { pathname } = useLocation()
|
const { pathname } = useLocation()
|
||||||
|
const location = window.location
|
||||||
|
const cleanedPathName = location.pathname.replace(pathname, '')
|
||||||
|
|
||||||
return window.location.pathname.replace(pathname, '')
|
return `${location.protocol}//${location.host}${cleanedPathName}`
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue