summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-07-01 12:06:38 +0200
committerGitHub <noreply@github.com>2016-07-01 12:06:38 +0200
commit44a8a1365560888bc712062b79024e6d4218d4c0 (patch)
tree3ffad3e2ea20107ba1d2a89747dd79beb1909d1d
parent4c426ad9707651820dbeb0c7d0c798fcff1d690b (diff)
parent779ee95834a2f4ace43f96da2d225957aef5f7d5 (diff)
downloadnextcloud-server-44a8a1365560888bc712062b79024e6d4218d4c0.tar.gz
nextcloud-server-44a8a1365560888bc712062b79024e6d4218d4c0.zip
Merge pull request #25315 from owncloud/stable9.1-search-preventinfiniteloop
[stable9.1] Prevent infinite loop in search auto-nextpage
-rw-r--r--apps/files/js/filelist.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 18f17a7207c..690e5e70fdb 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -2352,13 +2352,16 @@
*/
setFilter:function(filter) {
var total = 0;
+ if (this._filter === filter) {
+ return;
+ }
this._filter = filter;
this.fileSummary.setFilter(filter, this.files);
total = this.fileSummary.getTotal();
if (!this.$el.find('.mask').exists()) {
this.hideIrrelevantUIWhenNoFilesMatch();
}
- var that = this;
+
var visibleCount = 0;
filter = filter.toLowerCase();
@@ -2378,7 +2381,7 @@
if (visibleCount < total) {
$trs = this._nextPage(false);
}
- } while (visibleCount < total);
+ } while (visibleCount < total && $trs.length > 0);
this.$container.trigger('scroll');
},