From 8e2bc8bb926e57c09545d0928445d7cf6fbb7176 Mon Sep 17 00:00:00 2001 From: Vlad Stan Date: Wed, 12 Jul 2023 17:26:07 +0300 Subject: [PATCH] fix: infinte scroll --- static/components/customer-market/customer-market.html | 2 +- static/components/customer-market/customer-market.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/static/components/customer-market/customer-market.html b/static/components/customer-market/customer-market.html index 356fd1d..edc10a1 100644 --- a/static/components/customer-market/customer-market.html +++ b/static/components/customer-market/customer-market.html @@ -25,7 +25,7 @@ - +
diff --git a/static/components/customer-market/customer-market.js b/static/components/customer-market/customer-market.js index 521bff4..6879f27 100644 --- a/static/components/customer-market/customer-market.js +++ b/static/components/customer-market/customer-market.js @@ -20,7 +20,7 @@ async function customerMarket(path) { search: null, partialProducts: [], filteredProducts: [], - productsPerPage: 24, + productsPerPage: 12, startIndex: 0, lastProductIndex: 0, showProducts: true, @@ -41,7 +41,7 @@ async function customerMarket(path) { this.partialProducts = [] if (searchText.length < 3) { this.filteredProducts = [...this.products] - this.lastProductIndex = Math.min(this.filteredProducts.length, 24) + this.lastProductIndex = Math.min(this.filteredProducts.length, this.productsPerPage) this.partialProducts.push(...this.filteredProducts.slice(0, this.lastProductIndex)) setTimeout(() => this.showProducts = true, 0) return @@ -58,7 +58,7 @@ async function customerMarket(path) { ) }) this.startIndex = 0 - this.lastProductIndex = Math.min(this.filteredProducts.length, 24) + this.lastProductIndex = Math.min(this.filteredProducts.length, this.productsPerPage) this.partialProducts.push(...this.filteredProducts.slice(0, this.lastProductIndex)) setTimeout(() => { this.showProducts = true }, 0)