Skip to content

EspoCRM – Open Source CRM Application

Show more race condition fix

Yurii3674fc020458
diff --git a/client/src/views/record/list-base.ts b/client/src/views/record/list-base.ts
index dca2b3bc81..5b7a30fd02 100644
--- a/client/src/views/record/list-base.ts
+++ b/client/src/views/record/list-base.ts
@@ -3223,25 +3223,22 @@ abstract class ListBaseRecordView<
for (let i = initialCount; i < collection.length; i++) {
const model = collection.at(i)!;
- this.buildRow(i, model, view => {
- const model = view.model!;
+ const existingRow = this.getDomRowItem(model.id!);
- const existingRow = this.getDomRowItem(model.id!);
+ if (existingRow) {
+ existingRow.remove();
+ }
- if (existingRow) {
- existingRow.remove();
- }
+ $list?.append(this.getRowContainerHtml(model.id!));
- $list?.append(this.getRowContainerHtml(model.id!));
+ this.buildRow(i, model, async view => {
+ await view.render();
- view.render()
- .then(() => {
- rowsReady++;
+ rowsReady++;
- if (rowsReady === rowCount) {
- final();
- }
- });
+ if (rowsReady === rowCount) {
+ final();
+ }
});
}