@swell/apps-sdk 1.0.165 → 1.0.166

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.
package/dist/index.cjs CHANGED
@@ -21621,15 +21621,14 @@ ${content.slice(pos)}`;
21621
21621
  async renderDataFields(data, fields) {
21622
21622
  const promises = [];
21623
21623
  for (const key of fields) {
21624
- if (typeof data[key] === "string") {
21625
- promises.push(
21626
- this.renderTemplateString(data[key], data).then((value) => {
21627
- if (data) {
21628
- data[key] = value;
21629
- }
21630
- })
21631
- );
21632
- }
21624
+ const promise = typeof data[key] === "string" ? this.renderTemplateString(data[key], data) : Promise.resolve();
21625
+ promises.push(
21626
+ promise.then((value) => {
21627
+ return value ? value : this.globals[key];
21628
+ }).then((value) => {
21629
+ data[key] = value;
21630
+ })
21631
+ );
21633
21632
  }
21634
21633
  if (promises.length > 0) {
21635
21634
  data = { ...data };