@swell/apps-sdk 1.0.165 → 1.0.167

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.mjs CHANGED
@@ -21481,15 +21481,14 @@ ${content.slice(pos)}`;
21481
21481
  async renderDataFields(data, fields) {
21482
21482
  const promises = [];
21483
21483
  for (const key of fields) {
21484
- if (typeof data[key] === "string") {
21485
- promises.push(
21486
- this.renderTemplateString(data[key], data).then((value) => {
21487
- if (data) {
21488
- data[key] = value;
21489
- }
21490
- })
21491
- );
21492
- }
21484
+ const promise = typeof data[key] === "string" ? this.renderTemplateString(data[key], data) : Promise.resolve();
21485
+ promises.push(
21486
+ promise.then((value) => {
21487
+ return value ? value : this.globals[key];
21488
+ }).then((value) => {
21489
+ data[key] = value;
21490
+ })
21491
+ );
21493
21492
  }
21494
21493
  if (promises.length > 0) {
21495
21494
  data = { ...data };