@embarkai/ui-kit 0.3.1 → 0.3.2
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/iframe/index.html +1 -1
- package/dist/iframe/main.js +1 -1
- package/dist/index.cjs +11 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +11 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15499,7 +15499,7 @@ var init_package = __esm({
|
|
|
15499
15499
|
"package.json"() {
|
|
15500
15500
|
package_default = {
|
|
15501
15501
|
name: "@embarkai/ui-kit",
|
|
15502
|
-
version: "0.3.
|
|
15502
|
+
version: "0.3.2",
|
|
15503
15503
|
description: "React UI components and hooks for EmbarkAI authentication and Account Abstraction",
|
|
15504
15504
|
type: "module",
|
|
15505
15505
|
main: "./dist/index.cjs",
|
|
@@ -16357,6 +16357,7 @@ function WalletConnectHandler() {
|
|
|
16357
16357
|
[qc, passportWalletAddress, setProviderType, setPage, setIsWalletLinking]
|
|
16358
16358
|
);
|
|
16359
16359
|
const [hasStartedLinking, setHasStartedLinking] = React8.useState(false);
|
|
16360
|
+
const [modalWasOpened, setModalWasOpened] = React8.useState(false);
|
|
16360
16361
|
useEffect36(() => {
|
|
16361
16362
|
if (isWalletLinking && !hasStartedLinking) {
|
|
16362
16363
|
console.log("[WalletConnectHandler] Starting wallet link flow:", {
|
|
@@ -16380,6 +16381,7 @@ function WalletConnectHandler() {
|
|
|
16380
16381
|
}
|
|
16381
16382
|
if (!isWalletLinking && hasStartedLinking) {
|
|
16382
16383
|
setHasStartedLinking(false);
|
|
16384
|
+
setModalWasOpened(false);
|
|
16383
16385
|
const shouldKeepConnected = walletMode === "direct" || walletMode === "both";
|
|
16384
16386
|
if (isConnected && !shouldKeepConnected) disconnect();
|
|
16385
16387
|
}
|
|
@@ -16394,12 +16396,18 @@ function WalletConnectHandler() {
|
|
|
16394
16396
|
walletMode
|
|
16395
16397
|
]);
|
|
16396
16398
|
useEffect36(() => {
|
|
16397
|
-
if (
|
|
16399
|
+
if (connectModalOpen && hasStartedLinking) {
|
|
16400
|
+
setModalWasOpened(true);
|
|
16401
|
+
}
|
|
16402
|
+
}, [connectModalOpen, hasStartedLinking]);
|
|
16403
|
+
useEffect36(() => {
|
|
16404
|
+
if (modalWasOpened && !connectModalOpen && !isConnected && isWalletLinking) {
|
|
16398
16405
|
console.log("[WalletConnectHandler] Modal closed without connecting");
|
|
16399
16406
|
onLinkingComplete(false);
|
|
16400
16407
|
setHasStartedLinking(false);
|
|
16408
|
+
setModalWasOpened(false);
|
|
16401
16409
|
}
|
|
16402
|
-
}, [connectModalOpen,
|
|
16410
|
+
}, [connectModalOpen, modalWasOpened, isConnected, isWalletLinking]);
|
|
16403
16411
|
useEffect36(() => {
|
|
16404
16412
|
if (isWalletLinking) {
|
|
16405
16413
|
const timeout = setTimeout(() => {
|