-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Links for wallets #2265
Links for wallets #2265
Conversation
PR deployed in Google Cloud |
PR deployed in Google Cloud |
@@ -128,6 +129,7 @@ export function getEvmConnectors( | |||
get shown() { | |||
return !isMobile() || this.installed | |||
}, | |||
extensionName: 'metamask' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use the existing id
for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was just for consistency with the object we get from wallets but can def use ID
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mainly saying it because the typing isn't quite right now, as it's casting to EvmConnectorMeta
, but not all connectors have the extensionName
. I'd prefer using id
and then doing a check for it in getAdjustedInstallUrl
69438ae
to
58eb536
Compare
@@ -26,6 +26,7 @@ export type EvmConnectorMeta = { | |||
id: string | |||
title: string | |||
installUrl: string | |||
extensionName: string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leftover extensionName
const getAdjustedInstallUrl = (wallet: { extensionName: string; installUrl: string }): string => { | ||
const browser = getSupportedBrowser() | ||
const { extensionName, installUrl } = wallet | ||
if (browser === 'firefox') { | ||
return `https://addons.mozilla.org/en-US/firefox/addon/${walletsList[extensionName || 'metamask']}/` | ||
} else { | ||
return installUrl | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const getAdjustedInstallUrl = (wallet: { extensionName: string; installUrl: string }): string => { | |
const browser = getSupportedBrowser() | |
const { extensionName, installUrl } = wallet | |
if (browser === 'firefox') { | |
return `https://addons.mozilla.org/en-US/firefox/addon/${walletsList[extensionName || 'metamask']}/` | |
} else { | |
return installUrl | |
} | |
} | |
function getAdjustedInstallUrl(wallet: Wallet | EvmConnectorMeta): string { | |
const browser = getSupportedBrowser() | |
if (browser === 'firefox') { | |
return `https://addons.mozilla.org/en-US/firefox/addon/${walletsList['extensionName' in wallet ? wallet.extensionName : 'metamask']}/` | |
} else { | |
return wallet.installUrl | |
} | |
} |
71533a6
to
7ee8bab
Compare
Show non-supported banner regardless if user wallet is connected or not
7ee8bab
to
c7521ea
Compare
#1838