diff options
Diffstat (limited to 'plugins/base/frontend/src/main/components/navigationPaneSearch')
-rw-r--r-- | plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.tsx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.tsx b/plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.tsx index b11b36f6..152e7719 100644 --- a/plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.tsx +++ b/plugins/base/frontend/src/main/components/navigationPaneSearch/navigationPaneSearch.tsx @@ -4,6 +4,7 @@ import { DokkaFuzzyFilterComponent } from '../search/dokkaFuzzyFilter'; import { IWindow, Option } from '../search/types'; import './navigationPaneSearch.scss'; import ClearIcon from 'react-svg-loader!./clear.svg'; +import { relativizeUrlForRequest } from '../utils/requests'; export const NavigationPaneSearch = () => { const [navigationList, setNavigationList] = useState<Option[]>([]); @@ -31,9 +32,7 @@ export const NavigationPaneSearch = () => { } useEffect(() => { - const pathToRoot = (window as IWindow).pathToRoot - const url = pathToRoot.endsWith('/') ? `${pathToRoot}scripts/navigation-pane.json` : `${pathToRoot}/scripts/navigation-pane.json` - fetch(url) + fetch(relativizeUrlForRequest('scripts/navigation-pane.json')) .then(response => response.json()) .then((result) => { setNavigationList(result.map((record: Option, idx: number) => { |