summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorDaniel Kesselberg <mail@danielkesselberg.de>2022-09-15 11:57:23 +0200
committerDaniel Kesselberg <mail@danielkesselberg.de>2022-09-15 12:01:28 +0200
commit1bfac6d0941894677117144519d14f8f3ed455ec (patch)
tree92efe0ecb9c687a8763ba96db03ab4c4bb949fea /core
parente1d9b0bae20510526b0d00c2afe464945847face (diff)
downloadnextcloud-server-1bfac6d0941894677117144519d14f8f3ed455ec.tar.gz
nextcloud-server-1bfac6d0941894677117144519d14f8f3ed455ec.zip
Improve loading for tags
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>
Diffstat (limited to 'core')
-rw-r--r--core/src/systemtags/systemtagscollection.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/core/src/systemtags/systemtagscollection.js b/core/src/systemtags/systemtagscollection.js
index 685eb65182a..b123ef30fe4 100644
--- a/core/src/systemtags/systemtagscollection.js
+++ b/core/src/systemtags/systemtagscollection.js
@@ -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)
@@ -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)
}