fix: skip wallet verification gate when logged in
This commit is contained in:
@@ -153,6 +153,17 @@ export function getInjectedWallet(kind?: WalletKind): EthereumProvider | null {
|
||||
return match ?? null;
|
||||
}
|
||||
|
||||
export async function getConnectedInjectedAddress(
|
||||
kind?: WalletKind,
|
||||
): Promise<string | null> {
|
||||
const ethereum = getInjectedWallet(kind);
|
||||
if (!ethereum) return null;
|
||||
const accounts = await ethereum
|
||||
.request<unknown[]>({ method: "eth_accounts" })
|
||||
.catch((): unknown[] => []);
|
||||
return accounts.find(isAddress) ?? null;
|
||||
}
|
||||
|
||||
/** Diagnostic: log what injected providers the browser exposes. */
|
||||
export function logWalletProviders(): void {
|
||||
const ethereum = getInjectedEthereum();
|
||||
|
||||
Reference in New Issue
Block a user