@iblai/web-utils 1.10.7 → 1.10.9

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
@@ -1270,7 +1270,7 @@ async function redirectToAuthSpa(options) {
1270
1270
  window.localStorage.setItem(redirectPathStorageKey, redirectPath);
1271
1271
  }
1272
1272
  const platform = platformKey !== null && platformKey !== void 0 ? platformKey : getPlatformKey(redirectPath);
1273
- const redirectToUrl = (isNativeApp === null || isNativeApp === void 0 ? void 0 : isNativeApp()) ? scheme : `${window.location.origin}`;
1273
+ const redirectToUrl = window.location.origin;
1274
1274
  let authRedirectUrl = `${authUrl}/login?${queryParams.app}=${appName}`;
1275
1275
  authRedirectUrl += `&${queryParams.redirectTo}=${redirectToUrl}`;
1276
1276
  if (platform) {
@@ -1279,6 +1279,9 @@ async function redirectToAuthSpa(options) {
1279
1279
  if (logout) {
1280
1280
  authRedirectUrl += "&logout=1";
1281
1281
  }
1282
+ if ((isNativeApp === null || isNativeApp === void 0 ? void 0 : isNativeApp()) && scheme) {
1283
+ authRedirectUrl += `&scheme=${scheme}`;
1284
+ }
1282
1285
  // Small delay for any pending operations
1283
1286
  await new Promise((resolve) => setTimeout(resolve, 100));
1284
1287
  if (isNativeApp === null || isNativeApp === void 0 ? void 0 : isNativeApp()) {
@@ -1626,6 +1629,14 @@ const useTenantMetadata = ({ org, spa, skip = false, }) => {
1626
1629
  var _a;
1627
1630
  return (_a = data === null || data === void 0 ? void 0 : data.metadata) === null || _a === void 0 ? void 0 : _a.support_email;
1628
1631
  };
1632
+ const getSupportPhone = (defaultSupportPhone) => {
1633
+ var _a;
1634
+ return ((_a = data === null || data === void 0 ? void 0 : data.metadata) === null || _a === void 0 ? void 0 : _a.support_phone) || defaultSupportPhone || "";
1635
+ };
1636
+ const isSupportPhoneEnabled = () => {
1637
+ var _a;
1638
+ return ((_a = data === null || data === void 0 ? void 0 : data.metadata) === null || _a === void 0 ? void 0 : _a.enable_support_phone) !== false;
1639
+ };
1629
1640
  const isMentorInappropriateContentEnabled = () => {
1630
1641
  var _a;
1631
1642
  return ((_a = data === null || data === void 0 ? void 0 : data.metadata) === null || _a === void 0 ? void 0 : _a.mentor_report_inappropriate_content) !== false;
@@ -1654,6 +1665,8 @@ const useTenantMetadata = ({ org, spa, skip = false, }) => {
1654
1665
  metadataLoaded: !isLoading && (data === null || data === void 0 ? void 0 : data.metadata),
1655
1666
  getAllMetadatas,
1656
1667
  getSupportEmail,
1668
+ getSupportPhone,
1669
+ isSupportPhoneEnabled,
1657
1670
  };
1658
1671
  };
1659
1672