Skip to content

Commit ce8fae8

Browse files
committed
updating dist
1 parent ff33cfd commit ce8fae8

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/LiveComponent/assets/dist/live_controller.js

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1107,7 +1107,7 @@ class default_1 extends Controller {
11071107
});
11081108
}
11091109
$render() {
1110-
this._makeRequest(null);
1110+
this._makeRequest(null, {});
11111111
}
11121112
_getValueFromElement(element) {
11131113
return element.dataset.value || element.value;
@@ -1121,17 +1121,18 @@ class default_1 extends Controller {
11211121
const clonedElement = cloneHTMLElement(element);
11221122
throw new Error(`The update() method could not be called for "${clonedElement.outerHTML}": the element must either have a "data-model" or "name" attribute set to the model name.`);
11231123
}
1124+
let finalValue = value;
11241125
if (/\[]$/.test(model)) {
11251126
const { currentLevelData, finalKey } = parseDeepData(this.dataValue, normalizeModelName(model));
11261127
const currentValue = currentLevelData[finalKey];
1127-
value = updateArrayDataFromChangedElement(element, value, currentValue);
1128+
finalValue = updateArrayDataFromChangedElement(element, value, currentValue);
11281129
}
11291130
else if (element instanceof HTMLInputElement
11301131
&& element.type === 'checkbox'
11311132
&& !element.checked) {
1132-
value = null;
1133+
finalValue = null;
11331134
}
1134-
this.$updateModel(model, value, shouldRender, element.hasAttribute('name') ? element.getAttribute('name') : null, {});
1135+
this.$updateModel(model, finalValue, shouldRender, element.hasAttribute('name') ? element.getAttribute('name') : null, {});
11351136
}
11361137
$updateModel(model, value, shouldRender = true, extraModelName = null, options = {}) {
11371138
const directives = parseDirectives(model);
@@ -1427,10 +1428,13 @@ class default_1 extends Controller {
14271428
}
14281429
else {
14291430
callback = () => {
1430-
this._makeRequest(actionName);
1431+
this._makeRequest(actionName, {});
14311432
};
14321433
}
14331434
const timer = setInterval(() => {
1435+
if (this.renderPromiseStack.countActivePromises() > 0) {
1436+
return;
1437+
}
14341438
callback();
14351439
}, duration);
14361440
this.pollingIntervals.push(timer);
@@ -1539,6 +1543,9 @@ class PromiseStack {
15391543
findPromiseIndex(promise) {
15401544
return this.stack.findIndex((item) => item === promise);
15411545
}
1546+
countActivePromises() {
1547+
return this.stack.length;
1548+
}
15421549
}
15431550
const parseLoadingAction = function (action, isLoading) {
15441551
switch (action) {

0 commit comments

Comments
 (0)