summaryrefslogtreecommitdiffstats
path: root/web/react/components/search_bar.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'web/react/components/search_bar.jsx')
-rw-r--r--web/react/components/search_bar.jsx9
1 files changed, 6 insertions, 3 deletions
diff --git a/web/react/components/search_bar.jsx b/web/react/components/search_bar.jsx
index fae26f803..0da43e8cd 100644
--- a/web/react/components/search_bar.jsx
+++ b/web/react/components/search_bar.jsx
@@ -106,11 +106,14 @@ export default class SearchBar extends React.Component {
if (terms.length) {
this.setState({isSearching: true});
- if(terms.search(/\*\s*$/) == -1) // append * if not present
- terms = terms + "*";
+ // append * if not present
+ let searchTerms = terms;
+ if (searchTerms.search(/\*\s*$/) === -1) {
+ searchTerms = searchTerms + '*';
+ }
client.search(
- terms,
+ searchTerms,
(data) => {
this.setState({isSearching: false});
if (utils.isMobile()) {