From f28fcde90ca14dfeef9bcd5d052e54b6fdba8adf Mon Sep 17 00:00:00 2001 From: Yuri Kuznetsov Date: Wed, 15 Apr 2020 13:57:46 +0300 Subject: [PATCH] collection fix --- client/src/collection.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/client/src/collection.js b/client/src/collection.js index b2faa95863..03d21a0b95 100644 --- a/client/src/collection.js +++ b/client/src/collection.js @@ -147,13 +147,17 @@ define('collection', [], function () { this.where = options.where || this.where; + var length = this.length + this.lengthCorrection; + if (!('maxSize' in options)) { - options.data.maxSize = options.more ? this.maxSize : ((this.length > this.maxSize) ? this.length : this.maxSize); + options.data.maxSize = options.more ? this.maxSize : ( + (length > this.maxSize) ? length : this.maxSize + ); } else { options.data.maxSize = options.maxSize; } - options.data.offset = options.more ? this.length + this.lengthCorrection : this.offset; + options.data.offset = options.more ? length : this.offset; options.data.orderBy = this.orderBy; options.data.order = this.order; options.data.where = this.getWhere();