diff options
author | geireann <geireann.lindfield@gmail.com> | 2022-10-31 14:33:42 -0400 |
---|---|---|
committer | geireann <geireann.lindfield@gmail.com> | 2022-10-31 14:33:42 -0400 |
commit | 85f9dd5b114ed44a13c11eeded12666f0d7e7be2 (patch) | |
tree | b6bbdd3319312eb26dce931c7b5ab0c6514e84d3 /src/fields/List.ts | |
parent | aaf2c5fb4c0b6c6063f824eda3ff29c3bf18d2c4 (diff) | |
parent | 70c998562c8560283a7d6b9a1ae78b9207e3720f (diff) |
Merge branch 'master' of https://github.com/brown-dash/Dash-Web
Diffstat (limited to 'src/fields/List.ts')
-rw-r--r-- | src/fields/List.ts | 8 |
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 |