@bze/bze-ui-kit 1.0.12 → 1.0.13
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 +8 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3616,34 +3616,34 @@ var registerBzeEncoders = (client) => {
|
|
|
3616
3616
|
|
|
3617
3617
|
// src/hooks/useSigningClient.ts
|
|
3618
3618
|
var useSigningClient = ({ chainName }) => {
|
|
3619
|
-
const { getSigningClient, signingClientError, wallet, chain } = (0, import_react4.useChain)(chainName != null ? chainName : getChainName());
|
|
3619
|
+
const { getSigningClient, signingClientError, wallet, chain, address } = (0, import_react4.useChain)(chainName != null ? chainName : getChainName());
|
|
3620
3620
|
const [signingClient, setSigningClient] = (0, import_react3.useState)(null);
|
|
3621
3621
|
const [isSigningClientReady, setIsSigningClientReady] = (0, import_react3.useState)(false);
|
|
3622
|
-
const
|
|
3622
|
+
const initializedForAddress = (0, import_react3.useRef)(null);
|
|
3623
3623
|
const createSigningClient = (0, import_react3.useCallback)(async () => {
|
|
3624
3624
|
return getSigningClient();
|
|
3625
3625
|
}, [getSigningClient]);
|
|
3626
3626
|
(0, import_react3.useEffect)(() => {
|
|
3627
|
-
if (!wallet || !chain) {
|
|
3628
|
-
if (
|
|
3627
|
+
if (!wallet || !chain || !address) {
|
|
3628
|
+
if (initializedForAddress.current !== null) {
|
|
3629
3629
|
setSigningClient(null);
|
|
3630
3630
|
setIsSigningClientReady(false);
|
|
3631
|
-
|
|
3631
|
+
initializedForAddress.current = null;
|
|
3632
3632
|
}
|
|
3633
3633
|
return;
|
|
3634
3634
|
}
|
|
3635
|
-
if (
|
|
3635
|
+
if (initializedForAddress.current === address) return;
|
|
3636
3636
|
const load = async () => {
|
|
3637
3637
|
const client = await createSigningClient();
|
|
3638
3638
|
if (client) {
|
|
3639
3639
|
registerBzeEncoders(client);
|
|
3640
3640
|
setSigningClient(client);
|
|
3641
3641
|
setIsSigningClientReady(true);
|
|
3642
|
-
|
|
3642
|
+
initializedForAddress.current = address;
|
|
3643
3643
|
}
|
|
3644
3644
|
};
|
|
3645
3645
|
load();
|
|
3646
|
-
}, [wallet, chain, createSigningClient]);
|
|
3646
|
+
}, [wallet, chain, address, createSigningClient]);
|
|
3647
3647
|
return {
|
|
3648
3648
|
signingClientError,
|
|
3649
3649
|
signingClient,
|