btc-wallet 0.5.64-beta → 0.5.65-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 +5 -6
- package/dist/index.js.map +3 -3
- package/esm/index.js +5 -6
- package/esm/index.js.map +3 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
@@ -2571,6 +2571,8 @@ var ConnectProvider = ({
|
|
2571
2571
|
}, [connector, requestAccount]);
|
2572
2572
|
(0, import_react10.useEffect)(() => {
|
2573
2573
|
const onAccountChange = (accounts2) => {
|
2574
|
+
if (!accounts2.length)
|
2575
|
+
return;
|
2574
2576
|
setAccounts(accounts2);
|
2575
2577
|
};
|
2576
2578
|
connector == null ? void 0 : connector.on("accountsChanged", onAccountChange);
|
@@ -2882,16 +2884,13 @@ function useBtcWalletSelector() {
|
|
2882
2884
|
const connectWallet = (useModal = false) => __async(this, null, function* () {
|
2883
2885
|
if (connectModalOpen)
|
2884
2886
|
return null;
|
2885
|
-
const account = accounts == null ? void 0 : accounts[0];
|
2886
|
-
if (account)
|
2887
|
-
return account;
|
2888
2887
|
try {
|
2889
2888
|
if (useModal) {
|
2890
2889
|
openConnectModal == null ? void 0 : openConnectModal();
|
2891
2890
|
} else {
|
2892
2891
|
yield requestDirectAccount(connectorRef.current);
|
2893
2892
|
}
|
2894
|
-
const
|
2893
|
+
const account = yield retryOperation(
|
2895
2894
|
() => window.btcContext.account,
|
2896
2895
|
(res) => !!res,
|
2897
2896
|
{
|
@@ -2899,7 +2898,7 @@ function useBtcWalletSelector() {
|
|
2899
2898
|
delayMs: 1e3
|
2900
2899
|
}
|
2901
2900
|
);
|
2902
|
-
return
|
2901
|
+
return account || null;
|
2903
2902
|
} catch (error) {
|
2904
2903
|
console.error("btcLoginError", error);
|
2905
2904
|
context.emit("btcLoginError");
|
@@ -5279,7 +5278,7 @@ function getGroup(state) {
|
|
5279
5278
|
|
5280
5279
|
// src/index.ts
|
5281
5280
|
var getVersion = () => {
|
5282
|
-
return "0.5.
|
5281
|
+
return "0.5.65-beta";
|
5283
5282
|
};
|
5284
5283
|
if (typeof window !== "undefined") {
|
5285
5284
|
window.__BTC_WALLET_VERSION = getVersion();
|