@iblai/web-utils 1.7.0 → 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
@@ -4009,9 +4009,8 @@ function formatProdErrorMessage(code) {
4009
4009
  const SUBSCRIPTION_USER_CAPABILITIES = {
4010
4010
  FREE_TRIAL: "FREE_TRIAL"};
4011
4011
 
4012
- const initialState$7 = {
4012
+ const initialState$8 = {
4013
4013
  openPricingModal: false,
4014
- openAppleRestrictionModal: false,
4015
4014
  freeTrialUsageOptions: {
4016
4015
  count: 0,
4017
4016
  limitReached: false,
@@ -4032,14 +4031,11 @@ const initialState$7 = {
4032
4031
  };
4033
4032
  const subscriptionSlice = createSlice({
4034
4033
  name: "subscription",
4035
- initialState: initialState$7,
4034
+ initialState: initialState$8,
4036
4035
  reducers: {
4037
4036
  setOpenPricingModal(state, action) {
4038
4037
  state.openPricingModal = action.payload;
4039
4038
  },
4040
- setOpenAppleRestrictionModal(state, action) {
4041
- state.openAppleRestrictionModal = action.payload;
4042
- },
4043
4039
  setFreeTrialUsageOptions(state, action) {
4044
4040
  state.freeTrialUsageOptions = action.payload;
4045
4041
  },
@@ -4054,9 +4050,24 @@ const subscriptionSlice = createSlice({
4054
4050
  },
4055
4051
  },
4056
4052
  });
4057
- const { setOpenPricingModal, setOpenAppleRestrictionModal, setFreeTrialUsageOptions, setPricingModalData, setSubscriptionStatus, setError402Detected, } = subscriptionSlice.actions;
4053
+ const { setOpenPricingModal, setFreeTrialUsageOptions, setPricingModalData, setSubscriptionStatus, setError402Detected, } = subscriptionSlice.actions;
4058
4054
  const subscriptionReducer = subscriptionSlice.reducer;
4059
4055
 
4056
+ const initialState$7 = {
4057
+ openAppleRestrictionModal: false,
4058
+ };
4059
+ const appleRestrictionSlice = createSlice({
4060
+ name: "appleRestriction",
4061
+ initialState: initialState$7,
4062
+ reducers: {
4063
+ setOpenAppleRestrictionModal(state, action) {
4064
+ state.openAppleRestrictionModal = action.payload;
4065
+ },
4066
+ },
4067
+ });
4068
+ const { setOpenAppleRestrictionModal } = appleRestrictionSlice.actions;
4069
+ const appleRestrictionReducer = appleRestrictionSlice.reducer;
4070
+
4060
4071
  const initialState$6 = {
4061
4072
  topBannerOptions: {
4062
4073
  bannerText: "",
@@ -9873,9 +9884,8 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
9873
9884
  }
9874
9885
  }
9875
9886
  async function handleLoadTenantMetadata(tenantKey) {
9876
- var _a, _b;
9887
+ var _a;
9877
9888
  setIsLoading(true);
9878
- const MAIN_TENANT_KEY = "main";
9879
9889
  try {
9880
9890
  const data = await fetchTenantMetadata([
9881
9891
  {
@@ -9900,18 +9910,6 @@ function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, curr
9900
9910
  const { data: tenants } = await fetchUserTenants();
9901
9911
  const enhancedTenants = await enhanceTenants(tenants, data);
9902
9912
  saveUserTenants(enhancedTenants);
9903
- // If we're in an advertising tenant and user has other tenants,
9904
- // switch to a non-advertising, non-main tenant
9905
- const isCurrentTenantAdvertising = ((_b = data.metadata) === null || _b === void 0 ? void 0 : _b.is_advertising) || isAdvertisingTenant;
9906
- if (isCurrentTenantAdvertising &&
9907
- enhancedTenants &&
9908
- enhancedTenants.length > 0) {
9909
- const nonAdvertisingTenant = enhancedTenants.find((t) => !t.is_advertising && t.key !== MAIN_TENANT_KEY);
9910
- if (nonAdvertisingTenant) {
9911
- handleTenantSwitch(nonAdvertisingTenant.key, false, false);
9912
- return;
9913
- }
9914
- }
9915
9913
  if (currentTenant && currentTenant !== tenantKey) {
9916
9914
  setTenantKey(data.platform_key);
9917
9915
  const userAlreadyInTenant = enhancedTenants === null || enhancedTenants === void 0 ? void 0 : enhancedTenants.find((t) => t.key === tenantKey);
@@ -17914,6 +17912,8 @@ exports.addMessage = addMessage;
17914
17912
  exports.addProtocolToUrl = addProtocolToUrl;
17915
17913
  exports.advancedTabs = advancedTabs;
17916
17914
  exports.advancedTabsProperties = advancedTabsProperties;
17915
+ exports.appleRestrictionReducer = appleRestrictionReducer;
17916
+ exports.appleRestrictionSlice = appleRestrictionSlice;
17917
17917
  exports.chatActions = chatActions;
17918
17918
  exports.chatInputSlice = chatInputSlice;
17919
17919
  exports.chatInputSliceActions = chatInputSliceActions;