aboutsummaryrefslogtreecommitdiff
path: root/src/fields/List.ts
diff options
context:
space:
mode:
authormehekj <mehek.jethani@gmail.com>2022-11-07 12:57:52 -0500
committermehekj <mehek.jethani@gmail.com>2022-11-07 12:57:52 -0500
commita73521cdbccf9bed1326d24522e133fad4a0de26 (patch)
treee01371f6f845318831cf45f0dbc1d04d0d18f34c /src/fields/List.ts
parent213a92ba3aa39d144754029fde32b9d69b0f51cf (diff)
parent31a51e9dda07e48c88166bffbc8f1ad7166cd624 (diff)
Merge branch 'master' into schema-mehek
Diffstat (limited to 'src/fields/List.ts')
-rw-r--r--src/fields/List.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fields/List.ts b/src/fields/List.ts
index 5cc4ca543..edaa16003 100644
--- a/src/fields/List.ts
+++ b/src/fields/List.ts
@@ -278,7 +278,13 @@ class ListImpl<T extends Field> extends ObjectField {
const batchPromise = DocServer.GetRefFields(promised.map(p => p.promisedFieldId));
// as soon as we get the fields from the server, set all the list values in one
// action to generate one React dom update.
- batchPromise.then(pfields => promised.forEach(p => p.field.setValue(pfields[p.promisedFieldId])));
+ batchPromise.then(
+ action(pfields => {
+ for (let i = 0; i < promised.length; i++) {
+ promised[i].field.setValue(pfields[promised[i].promisedFieldId]);
+ }
+ })
+ );
// we also have to mark all lists items with this promise so that any calls to them
// will await the batch request and return the requested field value.
// This assumes the handler for 'promise' in the call above being invoked before the