declarative-forms 2.1.1 → 2.1.2

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.js CHANGED
@@ -1378,10 +1378,11 @@ var SelectField = class extends Field {
1378
1378
  async loadOptions(opts = {}) {
1379
1379
  const isCurrent = this.context.scheduler.claim(`options:${this.descriptor.name}`);
1380
1380
  const source = this.descriptor.options;
1381
- const requested = typeof source === "function" ? source(this.context.contextFor(this.descriptor)) : source;
1382
- const isAsync = requested instanceof Promise;
1383
- if (isAsync) this.select.setLoadingStatus();
1381
+ let isAsync = false;
1384
1382
  try {
1383
+ const requested = typeof source === "function" ? source(this.context.contextFor(this.descriptor)) : source;
1384
+ isAsync = requested instanceof Promise;
1385
+ if (isAsync) this.select.setLoadingStatus();
1385
1386
  const options = await requested ?? [];
1386
1387
  if (!isCurrent()) return;
1387
1388
  if (opts.reload) this.context.tooltips.reset(this.descriptor.name);