We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 03e8d2d commit 605e808Copy full SHA for 605e808
scripts/components/Root.js
@@ -5,8 +5,10 @@ import Directory from './Directory';
5
export default class Root extends Directory {
6
7
componentWillMount() {
8
- // FIXME: exists altanarive way?
9
- const baseUrl = document.querySelector('header.main-header a.logo').getAttribute('href');
+ // obtain repository URI
+ // - localhost:8080/owner/repo -> /owner/repo
10
+ // - localhost:8080/gitbucket/owner/repo -> /owner/repo
11
+ const baseUrl = document.querySelector('header.main-header a.logo').getAttribute('href').replace(`${document.location.protocol}//${document.location.host}`, '');
12
const relPath = document.location.pathname.replace(baseUrl, '');
13
let rootPath;
14
let branch;
0 commit comments