@iblai/web-utils 1.7.1 → 1.7.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
@@ -9884,9 +9884,8 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
9884
9884
  }
9885
9885
  }
9886
9886
  async function handleLoadTenantMetadata(tenantKey) {
9887
- var _a, _b;
9887
+ var _a;
9888
9888
  setIsLoading(true);
9889
- const MAIN_TENANT_KEY = "main";
9890
9889
  try {
9891
9890
  const data = await fetchTenantMetadata([
9892
9891
  {
@@ -9911,18 +9910,6 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
9911
9910
  const { data: tenants } = await fetchUserTenants();
9912
9911
  const enhancedTenants = await enhanceTenants(tenants, data);
9913
9912
  saveUserTenants(enhancedTenants);
9914
- // If we're in an advertising tenant and user has other tenants,
9915
- // switch to a non-advertising, non-main tenant
9916
- const isCurrentTenantAdvertising = ((_b = data.metadata) === null || _b === void 0 ? void 0 : _b.is_advertising) || isAdvertisingTenant;
9917
- if (isCurrentTenantAdvertising &&
9918
- enhancedTenants &&
9919
- enhancedTenants.length > 0) {
9920
- const nonAdvertisingTenant = enhancedTenants.find((t) => !t.is_advertising && t.key !== MAIN_TENANT_KEY);
9921
- if (nonAdvertisingTenant) {
9922
- handleTenantSwitch(nonAdvertisingTenant.key, false, false);
9923
- return;
9924
- }
9925
- }
9926
9913
  if (currentTenant && currentTenant !== tenantKey) {
9927
9914
  setTenantKey(data.platform_key);
9928
9915
  const userAlreadyInTenant = enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((t) => t.key === tenantKey);