@yomotech/view-toolkit 0.0.28 → 0.0.29

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.
@@ -2635,6 +2635,7 @@ class Couchdb {
2635
2635
  async buildTenantHeaders() {
2636
2636
  const tenantKey = await this.utilityService.getStorage('tenantKey');
2637
2637
  const tenantName = await this.utilityService.getStorage('tenantName');
2638
+ const selectedTenant = await this.utilityService.getLocalStorage('selectedTenant');
2638
2639
  if (tenantKey) {
2639
2640
  if (typeof tenantKey !== 'string' || !tenantKey.trim()) {
2640
2641
  throw new Error('Missing tenantKey');
@@ -2644,11 +2645,11 @@ class Couchdb {
2644
2645
  };
2645
2646
  }
2646
2647
  else {
2647
- if (typeof tenantName !== 'string' || !tenantName.trim()) {
2648
+ if (typeof tenantName !== 'string' || !tenantName.trim() || !tenantName.trim()) {
2648
2649
  throw new Error('Missing tenantName');
2649
2650
  }
2650
2651
  return {
2651
- 'X-Tenant': tenantName.trim(),
2652
+ 'X-Tenant': tenantName ? tenantName.trim() : selectedTenant.trim(),
2652
2653
  };
2653
2654
  }
2654
2655
  }