@yomotech/view-toolkit 0.0.27 → 0.0.28

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.
@@ -2696,19 +2696,22 @@ class ConfigService {
2696
2696
  }
2697
2697
  async loadOktaConfig(projectName) {
2698
2698
  try {
2699
+ let tenantKey = "";
2699
2700
  let tenantName = "";
2700
- let selectedTenant = "";
2701
2701
  if (this.platform.ANDROID || this.platform.IOS) {
2702
+ tenantKey = await this.utilityService.getLocalStorage('tenantKey');
2702
2703
  tenantName = await this.utilityService.getLocalStorage('tenantName');
2703
- selectedTenant = await this.utilityService.getLocalStorage('selectedTenant');
2704
2704
  }
2705
2705
  else {
2706
+ tenantKey = await this.utilityService.getStorage('tenantKey');
2706
2707
  tenantName = await this.utilityService.getStorage('tenantName');
2707
- selectedTenant = await this.utilityService.getLocalStorage('selectedTenant');
2708
2708
  }
2709
- let tenant = tenantName ? tenantName : selectedTenant;
2710
- console.log('tenant2: ', tenant);
2711
- this.config = await this.couchdbService.getFileContentFromCouchDb(`${tenant}_${projectName}`, 'environments/environment.json');
2709
+ if (tenantName) {
2710
+ this.config = await this.couchdbService.getFileContentFromCouchDb(`${tenantName}_${projectName}`, 'environments/environment.json');
2711
+ }
2712
+ else {
2713
+ this.config = await this.couchdbService.getFileContentFromCouchDb(`${projectName}`, 'environments/environment.json');
2714
+ }
2712
2715
  if (this.platform.ANDROID || this.platform.IOS) {
2713
2716
  if (this.config.environment.login.mobile) {
2714
2717
  this.setConfiguration(this.config.environment.login.mobile);
@@ -2753,19 +2756,23 @@ class ConfigService {
2753
2756
  return this.config;
2754
2757
  }
2755
2758
  async loadKeycloakConfig(projectName) {
2759
+ let tenantKey = "";
2756
2760
  let tenantName = "";
2757
- let selectedTenant = "";
2758
2761
  if (this.platform.ANDROID || this.platform.IOS) {
2762
+ tenantKey = await this.utilityService.getLocalStorage('tenantKey');
2759
2763
  tenantName = await this.utilityService.getLocalStorage('tenantName');
2760
- selectedTenant = await this.utilityService.getLocalStorage('selectedTenant');
2761
2764
  }
2762
2765
  else {
2766
+ tenantKey = await this.utilityService.getStorage('tenantKey');
2763
2767
  tenantName = await this.utilityService.getStorage('tenantName');
2764
- selectedTenant = await this.utilityService.getLocalStorage('selectedTenant');
2765
2768
  }
2766
- let tenant = tenantName ? tenantName : selectedTenant;
2767
- console.log('tenant1: ', tenant);
2768
- const env = await this.couchdbService.getFileContentFromCouchDb(`${tenant}_${projectName}`, 'environments/environment.json');
2769
+ let env = {};
2770
+ if (tenantName) {
2771
+ env = await this.couchdbService.getFileContentFromCouchDb(`${tenantName}_${projectName}`, 'environments/environment.json');
2772
+ }
2773
+ else {
2774
+ env = await this.couchdbService.getFileContentFromCouchDb(`${projectName}`, 'environments/environment.json');
2775
+ }
2769
2776
  if (env?.environment?.login.type === "keycloak") {
2770
2777
  if (this.platform.ANDROID || this.platform.IOS) {
2771
2778
  this.keycloakConfig = {