Skip to content

Commit

Permalink
Make min search length a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
tankerkiller125 committed Nov 24, 2020
1 parent 3e3b2dc commit f2c7030
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion js/src/forum/components/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ import UsersSearchSource from './UsersSearchSource';
* - state: SearchState instance.
*/
export default class Search extends Component {
static MIN_SEARCH_LEN = 3;

oninit(vnode) {
super.oninit(vnode);
this.state = this.attrs.state;
Expand Down Expand Up @@ -152,7 +154,7 @@ export default class Search extends Component {
search.searchTimeout = setTimeout(() => {
if (state.isCached(query)) return;

if (query.length >= 3) {
if (query.length >= Search.MIN_SEARCH_LEN) {
search.sources.map((source) => {
if (!source.search) return;

Expand Down

0 comments on commit f2c7030

Please sign in to comment.