Skip to content

Commit

Permalink
Fix TS errors
Browse files Browse the repository at this point in the history
  • Loading branch information
kattylucy committed Jul 10, 2024
1 parent 092b588 commit 71533a6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions centrifuge-react/src/components/WalletProvider/WalletDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ type Props = {
showFinoa?: boolean
}

type Wallet = {
installUrl: string
extensionName?: string
}

const title = {
networks: 'Connect wallet',
wallets: 'Connect wallet',
Expand All @@ -49,11 +54,12 @@ const walletsList: { [key: string]: string } = {
metamask: 'ether-metamask',
}

const getAdjustedInstallUrl = (wallet: { extensionName: string; installUrl: string }): string => {
const getAdjustedInstallUrl = (wallet: Wallet): string => {
const browser = getSupportedBrowser()
const { installUrl } = wallet
if (browser === 'firefox') {
return `https://addons.mozilla.org/en-US/firefox/addon/${walletsList['extensionName' in wallet ? wallet.extensionName : 'metamask']}/`
const extensionName = wallet.extensionName ?? 'metamask'
return `https://addons.mozilla.org/en-US/firefox/addon/${walletsList[extensionName]}/`
} else {
return installUrl
}
Expand Down

0 comments on commit 71533a6

Please sign in to comment.