btc-wallet 0.5.52-beta → 0.5.53-beta

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
@@ -2390,12 +2390,15 @@ var ConnectProvider = ({
2390
2390
  name: ((_a = Object.keys(options.aaOptions.accountContracts)) == null ? void 0 : _a[0]) || "BTC",
2391
2391
  version: ((_c = options.aaOptions.accountContracts[((_b = Object.keys(options.aaOptions.accountContracts)) == null ? void 0 : _b[0]) || "BTC"]) == null ? void 0 : _c[0].version) || "1.0.0"
2392
2392
  });
2393
- const initConnectorId = (0, import_react10.useCallback)(() => {
2393
+ const getConnectorId = (0, import_react10.useCallback)(() => {
2394
+ if (typeof window === "undefined") {
2395
+ return "";
2396
+ }
2394
2397
  const id = localStorage.getItem("current-connector-id");
2395
- setConnectorId(id || "");
2398
+ return id != null ? id : "";
2396
2399
  }, []);
2397
2400
  const getConnector = (0, import_react10.useCallback)(() => {
2398
- const connectorId2 = localStorage.getItem("current-connector-id");
2401
+ const connectorId2 = getConnectorId();
2399
2402
  return connectors.find((item) => item.metadata.id === connectorId2);
2400
2403
  }, [connectorId, connectors]);
2401
2404
  const setAccountContract = (0, import_react10.useCallback)(
@@ -2409,8 +2412,11 @@ var ConnectProvider = ({
2409
2412
  [options.aaOptions.accountContracts, _setAccountContract]
2410
2413
  );
2411
2414
  (0, import_react10.useEffect)(() => {
2412
- initConnectorId();
2413
- }, [autoConnect, initConnectorId]);
2415
+ const connectorId2 = getConnectorId();
2416
+ if (connectorId2) {
2417
+ setConnectorId(connectorId2);
2418
+ }
2419
+ }, [autoConnect, getConnectorId]);
2414
2420
  const evmSupportChainIds = (0, import_react10.useMemo)(() => {
2415
2421
  var _a2;
2416
2422
  let chainIds = (_a2 = options.aaOptions.accountContracts[accountContract.name]) == null ? void 0 : _a2.filter((item) => item.version === accountContract.version).map((item) => item.chainIds).reduce((a, b) => {
@@ -5049,7 +5055,7 @@ function getGroup(state) {
5049
5055
 
5050
5056
  // src/index.ts
5051
5057
  var getVersion = () => {
5052
- return "0.5.52-beta";
5058
+ return "0.5.53-beta";
5053
5059
  };
5054
5060
  if (typeof window !== "undefined") {
5055
5061
  window.__BTC_WALLET_VERSION = getVersion();