Skip to content

Commit d5e019c

Browse files
committed
repair search because of change in constants BASEPATH and HOMEPATH for better wiki location
1 parent 997a54d commit d5e019c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/components/OpenPageBar.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import PropTypes from 'prop-types';
66
import { Omnibar } from '@blueprintjs/select';
77
import { MenuItem } from '@blueprintjs/core';
88

9-
import { HOMEPATH, EXT } from '../constants';
9+
import { HOMEPATH, EXT, BASEPATH } from '../constants';
1010

1111
export default class OpenPageBar extends React.Component {
1212
constructor(props) {
@@ -50,7 +50,7 @@ export default class OpenPageBar extends React.Component {
5050
}
5151

5252
populateFileList(searchString = '') {
53-
find({ term: searchString, flags: 'ig' }, HOMEPATH, `.${EXT}`)
53+
find({ term: searchString, flags: 'ig' }, `${BASEPATH }/`, `.${EXT}`)
5454
.then((results) => {
5555
this.setFileList(results);
5656
});
@@ -74,14 +74,16 @@ OpenPageBar.propTypes = {
7474
isOpen: PropTypes.bool.isRequired,
7575
setCurrentFile: PropTypes.func.isRequired,
7676
setOpenPageBar: PropTypes.func.isRequired,
77-
}
77+
};
7878

7979
function renderItem(filePath, { handleClick, modifiers, query }) {
8080
if (!modifiers.matchesPredicate) {
8181
return null;
8282
}
8383

84-
const relPath = filePath.slice(HOMEPATH.length, -EXT.length);
84+
const relPath = filePath.slice(BASEPATH.length + 1, -EXT.length);
85+
console.log(relPath);
86+
8587
const text = relPath.split('/').join(' > ');
8688
return (
8789
<MenuItem

0 commit comments

Comments
 (0)