Skip to content

Commit

Permalink
Improve loading for tags
Browse files Browse the repository at this point in the history
When opening the tag select and type something the tags are loaded.

If you continue to type but the tags are not finally loaded yet (the first xhr request is still running)
another xhr request is triggered. This happens for every keystroke.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
  • Loading branch information
kesselb committed Sep 15, 2022
1 parent e1d9b0b commit 1bfac6d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/systemtags/systemtagscollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
fetch: function(options) {
var self = this
options = options || {}
if (this.fetched || options.force) {
if (this.fetched || this.working || options.force) {
// directly call handler
if (options.success) {
options.success(this, null, options)
Expand All @@ -79,10 +79,13 @@
return Promise.resolve()
}

this.working = true

var success = options.success
options = _.extend({}, options)
options.success = function() {
self.fetched = true
self.working = false
if (success) {
return success.apply(this, arguments)
}
Expand Down

0 comments on commit 1bfac6d

Please sign in to comment.