diff --git a/client/js/controls/tag_auto_complete_control.js b/client/js/controls/tag_auto_complete_control.js index b43cd9a4..2fffcf9e 100644 --- a/client/js/controls/tag_auto_complete_control.js +++ b/client/js/controls/tag_auto_complete_control.js @@ -6,7 +6,6 @@ const AutoCompleteControl = require('./auto_complete_control.js'); class TagAutoCompleteControl extends AutoCompleteControl { constructor(input, options) { - const allTags = tags.getNameToTagMap(); const caseSensitive = false; const minLengthForPartialSearch = 3; @@ -22,7 +21,7 @@ class TagAutoCompleteControl extends AutoCompleteControl { (a, b) => a.startsWith(b) : (a, b) => a.includes(b); text = transform(text); - return Array.from(allTags.entries()) + return Array.from(tags.getNameToTagMap().entries()) .filter(kv => match(transform(kv[0]), text)) .sort((kv1, kv2) => { return kv2[1].usages - kv1[1].usages; diff --git a/client/js/tags.js b/client/js/tags.js index e732400f..18b9b625 100644 --- a/client/js/tags.js +++ b/client/js/tags.js @@ -3,8 +3,8 @@ const misc = require('./util/misc.js'); const request = require('superagent'); -let _tags = null; -let _categories = null; +let _tags = new Map(); +let _categories = new Map(); let _stylesheet = null; function getTagByName(name) {