@vectoriox/iox-builder 2.6.1 → 2.7.0
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.
|
@@ -6085,6 +6085,10 @@ class BuilderRepeaterComponent {
|
|
|
6085
6085
|
this._source = '';
|
|
6086
6086
|
this._sourcePath = '';
|
|
6087
6087
|
this._limit = 10;
|
|
6088
|
+
/** Monotonic fetch token — editing a binding sets `source` and `sourcePath` as two separate inputs,
|
|
6089
|
+
* each firing a fetch; the transient mismatched one (old source + new path, or vice-versa) must not
|
|
6090
|
+
* clobber the correct result if it resolves last. Only the newest fetch's response is applied. */
|
|
6091
|
+
this._fetchSeq = 0;
|
|
6088
6092
|
}
|
|
6089
6093
|
ngOnInit() {
|
|
6090
6094
|
this.bindingSub = this.panelEventService.subscribe(event => {
|
|
@@ -6110,11 +6114,14 @@ class BuilderRepeaterComponent {
|
|
|
6110
6114
|
fetchData() {
|
|
6111
6115
|
if (!this._source)
|
|
6112
6116
|
return;
|
|
6117
|
+
const seq = ++this._fetchSeq;
|
|
6113
6118
|
this.isLoading = true;
|
|
6114
6119
|
this.cdr.markForCheck();
|
|
6115
6120
|
// Resolve BY ALIAS so `derived` sources (e.g. galleryImages = product.gallery) follow their
|
|
6116
6121
|
// parent. `sourcePath` (legacy/back-compat) still repeats over an array property inline.
|
|
6117
6122
|
this.dataSourceService.fetchRepeaterItemsByAlias(this._source, (a) => this.dsRegistry.findByAlias(a), this._sourcePath).subscribe(items => {
|
|
6123
|
+
if (seq !== this._fetchSeq)
|
|
6124
|
+
return; // a newer fetch superseded this one — ignore stale items
|
|
6118
6125
|
this.items = items.slice(0, this._limit);
|
|
6119
6126
|
this.refreshPreviews();
|
|
6120
6127
|
this.isLoading = false;
|