From a643411f6dd160dab6fa602f59f09f8a68f07e5f Mon Sep 17 00:00:00 2001 From: mohamedsalem401 Date: Wed, 5 Mar 2025 08:51:55 +0200 Subject: [PATCH] Fix bug with end index = 0 --- .../model/data_collection/ComponentDataCollection.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts b/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts index 380ec7737..c215dc244 100644 --- a/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts +++ b/packages/core/src/data_sources/model/data_collection/ComponentDataCollection.ts @@ -55,8 +55,8 @@ export default class ComponentDataCollection extends Component { getItemsCount() { const items = this.getDataSourceItems(); - const startIndex = Math.max(0, this.getConfigStartIndex() || 0); - const configEndIndex = this.getConfigEndIndex() || Number.MAX_VALUE; + const startIndex = Math.max(0, this.getConfigStartIndex() ?? 0); + const configEndIndex = this.getConfigEndIndex() ?? Number.MAX_VALUE; const endIndex = Math.min(items.length - 1, configEndIndex); const count = endIndex - startIndex + 1;