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
10 changes: 4 additions & 6 deletions src/components/WalletModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import React, { useState } from 'react';
import React, { useState, useMemo } from 'react';
import { useWalletStore } from '@/store/walletStore';
import { getWalletErrorMessage } from '@/utils/errorHandling';
import { toChainId } from '@/config/chains';
Expand Down Expand Up @@ -173,8 +173,8 @@ export const WalletModal: React.FC<WalletModalProps> = ({ isOpen, onClose }) =>
return null;
};

// Detect installed wallets
const detectInstalledWallets = () => {
// Memoize wallet detection so it doesn't re-run on every render
const installedWallets = useMemo(() => {
const installed = new Set<SupportedWalletId>();

// Detect MetaMask
Expand All @@ -191,9 +191,7 @@ export const WalletModal: React.FC<WalletModalProps> = ({ isOpen, onClose }) =>
// We'll consider it "available" but not "installed" in the traditional sense

return installed;
};

const installedWallets = detectInstalledWallets();
}, []);

const wallets: Array<{
id: SupportedWalletId;
Expand Down
Loading