Skip to content

Commit

Permalink
Don't show install links for unsupported browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
jribbink committed Aug 29, 2024
1 parent fbdb829 commit 96c5659
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hooks/useInstallLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { DeviceInfo, DeviceType } from '../helpers/device'
import { useConfig } from '../contexts/FclContext'
import { FCL_SERVICE_METHODS } from '../helpers/constants'
import { useMemo } from 'react'
import { Browser } from '../helpers/browsers'

export function useInstallLinks(wallet: Wallet) {
const { deviceInfo } = useDevice()
Expand Down Expand Up @@ -31,9 +32,10 @@ export function getInstallLinkForMethod(
}
return wallet.installLink?.mobile || null
case FCL_SERVICE_METHODS.EXT:
const isBrowserKnown = deviceInfo.browser !== Browser.UNKNOWN
return (
wallet.installLink?.[deviceInfo.browser] ||
wallet.installLink?.browser ||
(isBrowserKnown && wallet.installLink?.browser) ||
null
)
}
Expand Down

0 comments on commit 96c5659

Please sign in to comment.