Chore: Use optional chaining (#3795)

Use optional chaining to check `window.ethereum` object chain.
This commit is contained in:
Simeon Kerkola 2022-05-09 22:57:55 +03:00 committed by GitHub
parent 4274db67d5
commit bd4545538d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -215,7 +215,7 @@ export default function WalletModal({
// get wallets user can switch too, depending on device/browser
function getOptions() {
const isMetamask = window.ethereum && window.ethereum.isMetaMask
const isMetamask = !!window.ethereum?.isMetaMask
return Object.keys(SUPPORTED_WALLETS).map((key) => {
const option = SUPPORTED_WALLETS[key]
// check for mobile options