@volr/react 0.2.1 → 0.2.4

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.cjs CHANGED
@@ -10760,7 +10760,7 @@ function VolrProvider({ config, children }) {
10760
10760
  const client = react.useMemo(() => {
10761
10761
  if (!config.projectApiKey) {
10762
10762
  throw new Error(
10763
- "VolrProvider requires config.projectApiKey. Please set VITE_PROJECT_API_KEY environment variable or provide projectApiKey in config."
10763
+ "VolrProvider requires config.projectApiKey. Please provide projectApiKey in config."
10764
10764
  );
10765
10765
  }
10766
10766
  return new APIClient({
@@ -19628,8 +19628,6 @@ function useVolr() {
19628
19628
  );
19629
19629
  return {
19630
19630
  evm,
19631
- evmAddress: user?.evmAddress,
19632
- // deprecated, kept for backward compatibility
19633
19631
  email: user?.email,
19634
19632
  isLoggedIn: user !== null,
19635
19633
  signerType: user?.signerType,
@@ -19936,7 +19934,9 @@ Issued At: ${issuedAt}`;
19936
19934
  if (apiBaseUrl.includes("dev-api") || apiBaseUrl.includes("localhost")) {
19937
19935
  params.set("env", "dev");
19938
19936
  }
19939
- const lang = typeof navigator !== "undefined" ? navigator.language?.startsWith("ko") ? "ko" : "en" : "en";
19937
+ const detectedLang = typeof navigator !== "undefined" ? navigator.language?.toLowerCase().startsWith("ko") ? "ko" : "en" : "en";
19938
+ const allowedLocales = config.allowedLocales;
19939
+ const lang = allowedLocales && !allowedLocales.includes(detectedLang) ? "en" : detectedLang;
19940
19940
  params.set("lang", lang);
19941
19941
  return `https://sign.volr.io?${params.toString()}`;
19942
19942
  },