Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@ const ConnectUsing = () => {
variants={contentVariants}
>
<ConnectWithQRCode
switchConnectMethod={(id?: string) => {
//if (id) setId(id);
switchConnectMethod={() => {
setStatus(states.INJECTOR);
setTimeout(context.triggerResize, 10); // delay required here for modal to resize
}}
Expand All @@ -68,8 +67,7 @@ const ConnectUsing = () => {
variants={contentVariants}
>
<ConnectWithInjector
switchConnectMethod={(id?: string) => {
//if (id) setId(id);
switchConnectMethod={() => {
setStatus(states.QRCODE);
setTimeout(context.triggerResize, 10); // delay required here for modal to resize
}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,9 @@ const ConnectWithInjector: React.FC<{
if (status === states.UNAVAILABLE) return;

// UX: Give user time to see the UI before opening the extension
connectTimeout = setTimeout(runConnect, 600);
if (wallet?.connector.id !== 'familyAccountsProvider') {
connectTimeout = setTimeout(runConnect, 600);
}
return () => {
clearTimeout(connectTimeout);
};
Expand Down
15 changes: 13 additions & 2 deletions packages/connectkit/src/components/Pages/Connectors/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,13 @@ import {
import { OrDivider } from '../../Common/Modal';
import { FamilyAccountsButton } from '../../Common/FamilyAccountsButton';
import { isFamily } from '../../../utils/wallets';
import { states } from '../../ConnectModal/ConnectWithInjector';
import { useConnect } from '../../../hooks/useConnect';

const Wallets: React.FC = () => {
const context = useContext();
const locales = useLocales({});
const { connect } = useConnect();

const isMobile = useIsMobile();
const familyConnector = useFamilyConnector();
Expand All @@ -49,11 +52,19 @@ const Wallets: React.FC = () => {
<>
<FamilyAccountsButton
onClick={() => {
// Determine the correct connector to use
let connector;
if (familyConnector && isFamily()) {
context.setConnector(familyConnector);
connector = familyConnector;
} else {
context.setConnector(familyAccountsConnector);
connector = familyAccountsConnector;
}
context.setConnector(connector);
//connect directly
if (connector.id === 'familyAccountsProvider') {
connect({ connector: connector });
}
// Set route for UI updates
context.setRoute(routes.CONNECT);
}}
/>
Expand Down