fix: skip wallet verification gate when logged in

This commit is contained in:
TerryM
2026-06-04 07:39:17 +08:00
parent 8140828c11
commit 469e53a860
5 changed files with 204 additions and 20 deletions

View File

@@ -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();