Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/features/account/hooks/useSignInWithWallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ function useSignInWithWallet({ onSuccess, onError, source = 'Login', isAuth, log
proceedToAuth(web3Wallet.address);
} else {
isConnectingWalletRef.current = true;
web3Wallet.openModal();
web3Wallet.connect();
}
}, [ proceedToAuth, web3Wallet ]);

Expand Down
17 changes: 10 additions & 7 deletions src/features/connect-wallet/hooks/wallet/useWalletReown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,31 @@ export function useWalletReown({ source, onConnect }: Params): Result {
modalUnsubRef.current = runtime.subscribeModalState(setIsModalOpen);
}, []);

const openModal = React.useCallback(async() => {
// Loads the runtime and opens the AppKit modal, returning the runtime so `connect` can gate its analytics
// on `isReady`. The exposed `openModal` discards it (the `Result` contract is `Promise<void>`).
const loadAndOpenModal = React.useCallback(async() => {
setIsOpening(true);
const runtime = await ensureLoaded();
subscribeModal(runtime);
await runtime.openModal();
setIsOpening(false);
return runtime;
}, [ subscribeModal ]);

const openModal = React.useCallback(async() => {
await loadAndOpenModal();
}, [ loadAndOpenModal ]);

const connect = React.useCallback(async() => {
setIsOpening(true);
const runtime = await ensureLoaded();
subscribeModal(runtime);
await runtime.openModal();
setIsOpening(false);
const runtime = await loadAndOpenModal();
// Record a started connection only when the modal could actually open. A failed chunk load resolves to
// the disabled runtime whose `openModal` is a no-op — there is nothing for the user to complete, and no
// later bridge connect to attribute to this click.
if (runtime.isReady) {
mixpanel.logEvent(mixpanel.EventTypes.WALLET_CONNECT, { Source: source, Status: 'Started' });
isConnectionStarted.current = true;
}
}, [ source, subscribeModal ]);
}, [ source, loadAndOpenModal ]);

const disconnect = React.useCallback(async() => {
const runtime = await ensureLoaded();
Expand Down
2 changes: 1 addition & 1 deletion src/features/marketplace/pages/dapp/MarketplaceApp.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const testFn = async({ render, mockAssetResponse, mockEnvs, mockRpcResponse, moc
await expect(component).toHaveScreenshot();
};

test('base view +@dark-mode', testFn);
test('base view', testFn);

test.describe('mobile', () => {
test.use({ viewport: devices['iPhone 13 Pro'].viewport });
Expand Down
Binary file not shown.
Loading