@skyscanner/backpack-web 42.27.2 → 42.27.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -87,7 +87,7 @@ const withInfiniteScroll = ComponentToExtend => class WithInfiniteScroll extends
|
|
|
87
87
|
this.props.dataSource.onDataChange(this.updateData);
|
|
88
88
|
this.fetchItems({
|
|
89
89
|
index: 0,
|
|
90
|
-
elementsPerScroll: this.props.
|
|
90
|
+
elementsPerScroll: this.props.initiallyLoadedElements,
|
|
91
91
|
elementsToRender: []
|
|
92
92
|
}).then(newState => this.setStateAfterDsUpdate(newState));
|
|
93
93
|
}
|
|
@@ -122,10 +122,10 @@ const withInfiniteScroll = ComponentToExtend => class WithInfiniteScroll extends
|
|
|
122
122
|
// An ArrayDataSource initialized empty and then changed latter on via `updateData`
|
|
123
123
|
// In this case we want to load new data and not just replace the old one.
|
|
124
124
|
// "See More After" should also be computed again in this case.
|
|
125
|
-
const isFirstLoad = index < this.props.
|
|
125
|
+
const isFirstLoad = index < this.props.initiallyLoadedElements;
|
|
126
126
|
this.fetchItems({
|
|
127
127
|
index: 0,
|
|
128
|
-
elementsPerScroll: isFirstLoad ? this.props.
|
|
128
|
+
elementsPerScroll: isFirstLoad ? this.props.initiallyLoadedElements : index,
|
|
129
129
|
elementsToRender: [],
|
|
130
130
|
computeShowSeeMore: isFirstLoad
|
|
131
131
|
}).then(newState => this.setStateAfterDsUpdate(newState));
|