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 7df5df4 commit b5960d4Copy full SHA for b5960d4
js/net/TagsModel.js
@@ -27,12 +27,21 @@ SOFTWARE.
27
var s = {};
28
s.activePromise = null;
29
s.existing = null;
30
+ s.cache = {};
31
+
32
+ s._term = "";
33
34
s.search = function(term, existing) {
35
if (s.activePromise) {
36
s.activePromise.cancelled = true;
37
}
38
39
+ s._term = term.toLocaleLowerCase();
40
41
+ if (s.cache[s._term]) {
42
+ return Promise.resolve(s.cache[s._term]);
43
+ }
44
45
s.existing = {};
46
if (existing) {
47
for (var i=0;i<existing.length;i++) {
@@ -55,6 +64,8 @@ SOFTWARE.
55
64
cleanData.push(data[i].name);
56
65
57
66
67
+ s.cache[s._term] = cleanData;
68
58
69
return Promise.resolve(cleanData);
59
70
};
60
71
0 commit comments