Skip to content

Commit 423b39b

Browse files
fix double connect
1 parent 612d72d commit 423b39b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

packages/connectkit/src/components/ConnectModal/ConnectUsing.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,7 @@ const ConnectUsing = () => {
5151
variants={contentVariants}
5252
>
5353
<ConnectWithQRCode
54-
switchConnectMethod={(id?: string) => {
55-
//if (id) setId(id);
54+
switchConnectMethod={() => {
5655
setStatus(states.INJECTOR);
5756
setTimeout(context.triggerResize, 10); // delay required here for modal to resize
5857
}}
@@ -68,8 +67,7 @@ const ConnectUsing = () => {
6867
variants={contentVariants}
6968
>
7069
<ConnectWithInjector
71-
switchConnectMethod={(id?: string) => {
72-
//if (id) setId(id);
70+
switchConnectMethod={() => {
7371
setStatus(states.QRCODE);
7472
setTimeout(context.triggerResize, 10); // delay required here for modal to resize
7573
}}

packages/connectkit/src/components/ConnectModal/ConnectWithInjector/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,9 @@ const ConnectWithInjector: React.FC<{
188188
if (status === states.UNAVAILABLE) return;
189189

190190
// UX: Give user time to see the UI before opening the extension
191-
connectTimeout = setTimeout(runConnect, 600);
191+
if (wallet?.connector.id !== 'familyAccountsProvider') {
192+
connectTimeout = setTimeout(runConnect, 600);
193+
}
192194
return () => {
193195
clearTimeout(connectTimeout);
194196
};

packages/connectkit/src/components/Pages/Connectors/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ const Wallets: React.FC = () => {
6060
connector = familyAccountsConnector;
6161
}
6262
context.setConnector(connector);
63-
// connect directly
64-
connect({ connector });
63+
//connect directly
64+
connect({ connector: connector });
6565
// Set route for UI updates
6666
context.setRoute(routes.CONNECT);
6767
}}

0 commit comments

Comments
 (0)