Update Ledger capability check (w/ WebUSB) (#3666)

This commit is contained in:
Jaco Greeff 2020-09-11 22:07:29 +02:00 committed by GitHub
parent a6a766c36a
commit 33dad7d03a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -18,7 +18,7 @@ let ledger: Ledger | null = null;
export function isLedgerCapable (): boolean {
try {
return !!api && ALLOWED_CHAINS.map(([g]) => g).includes(api.genesisHash.toHex());
return !!(window as unknown as { USB?: unknown }).USB && !!api && ALLOWED_CHAINS.map(([g]) => g).includes(api.genesisHash.toHex());
} catch (error) {
return false;
}