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/esm/index.js
CHANGED
@@ -2501,6 +2501,8 @@ var ConnectProvider = ({
|
|
2501
2501
|
}, [connector, requestAccount]);
|
2502
2502
|
useEffect5(() => {
|
2503
2503
|
const onAccountChange = (accounts2) => {
|
2504
|
+
if (!accounts2.length)
|
2505
|
+
return;
|
2504
2506
|
setAccounts(accounts2);
|
2505
2507
|
};
|
2506
2508
|
connector == null ? void 0 : connector.on("accountsChanged", onAccountChange);
|
@@ -2812,16 +2814,13 @@ function useBtcWalletSelector() {
|
|
2812
2814
|
const connectWallet = (useModal = false) => __async(this, null, function* () {
|
2813
2815
|
if (connectModalOpen)
|
2814
2816
|
return null;
|
2815
|
-
const account = accounts == null ? void 0 : accounts[0];
|
2816
|
-
if (account)
|
2817
|
-
return account;
|
2818
2817
|
try {
|
2819
2818
|
if (useModal) {
|
2820
2819
|
openConnectModal == null ? void 0 : openConnectModal();
|
2821
2820
|
} else {
|
2822
2821
|
yield requestDirectAccount(connectorRef.current);
|
2823
2822
|
}
|
2824
|
-
const
|
2823
|
+
const account = yield retryOperation(
|
2825
2824
|
() => window.btcContext.account,
|
2826
2825
|
(res) => !!res,
|
2827
2826
|
{
|
@@ -2829,7 +2828,7 @@ function useBtcWalletSelector() {
|
|
2829
2828
|
delayMs: 1e3
|
2830
2829
|
}
|
2831
2830
|
);
|
2832
|
-
return
|
2831
|
+
return account || null;
|
2833
2832
|
} catch (error) {
|
2834
2833
|
console.error("btcLoginError", error);
|
2835
2834
|
context.emit("btcLoginError");
|
@@ -5211,7 +5210,7 @@ function getGroup(state) {
|
|
5211
5210
|
|
5212
5211
|
// src/index.ts
|
5213
5212
|
var getVersion = () => {
|
5214
|
-
return "0.5.
|
5213
|
+
return "0.5.65-beta";
|
5215
5214
|
};
|
5216
5215
|
if (typeof window !== "undefined") {
|
5217
5216
|
window.__BTC_WALLET_VERSION = getVersion();
|