@iblai/web-utils 1.11.10 → 1.11.11

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
@@ -1771,6 +1771,24 @@ async function preCacheMentorData(org, mentorId, userId, fetchMentorSettings, fe
1771
1771
  }
1772
1772
  }
1773
1773
 
1774
+ async function openExternalUrl(url) {
1775
+ if (!url || typeof window === "undefined")
1776
+ return;
1777
+ if (!isTauri()) {
1778
+ window.location.href = url;
1779
+ return;
1780
+ }
1781
+ try {
1782
+ const { invoke } = await import('@tauri-apps/api/core');
1783
+ await invoke("open_external_url", { url });
1784
+ }
1785
+ catch (error) {
1786
+ console.error("[openExternalUrl] Failed to open URL via Tauri host, falling back to navigation:", error);
1787
+ // Fallback to normal navigation if the native command is unavailable.
1788
+ window.location.href = url;
1789
+ }
1790
+ }
1791
+
1774
1792
  const useTenantMetadata = ({ org, spa, skip = false, }) => {
1775
1793
  const { data, isLoading, isError } = dataLayer.useGetTenantMetadataQuery([{ org }], {
1776
1794
  skip: skip || !org,
@@ -15018,7 +15036,7 @@ const useStripeUpgrade = ({ redirectUrl, sourcePlatformKey, mainPlatformKey, cur
15018
15036
  return;
15019
15037
  const target = redirectPlan === "free" ? resolvedFreeUrl : resolvedPremiumUrl;
15020
15038
  if (target) {
15021
- window.location.href = target;
15039
+ await openExternalUrl(target);
15022
15040
  }
15023
15041
  }
15024
15042
  catch (_a) {
@@ -19049,6 +19067,7 @@ exports.markdownToPlainText = markdownToPlainText;
19049
19067
  exports.monetizationSlice = monetizationSlice;
19050
19068
  exports.onStatusChange = onStatusChange;
19051
19069
  exports.onUpdate = onUpdate;
19070
+ exports.openExternalUrl = openExternalUrl;
19052
19071
  exports.parseCSV = parseCSV;
19053
19072
  exports.preCacheMentorData = preCacheMentorData;
19054
19073
  exports.rbacReducer = rbacReducer;