Skip to content

Commit

Permalink
Merge pull request #378 from LinkdropHQ/main_okx_wallet_fix
Browse files Browse the repository at this point in the history
added update for okx wallet
  • Loading branch information
spacehaz authored Sep 16, 2024
2 parents d665df8 + 3f611f9 commit 55dccb2
Showing 1 changed file with 40 additions and 18 deletions.
58 changes: 40 additions & 18 deletions src/components/pages/common/wallets-list/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,26 +179,47 @@ const defineOptionsList = (
const system = defineSystem()
// @ts-ignore
const injected = connectors.find(connector => connector.id === "injected")

if (!preferredWalletOn) {
if (defaultWalletApp === 'okx_wallet') {
const okxWallet = getInjectedWalletOption(
wallet,
system,
() => {
setStep('download_await')
},
connect,
<WalletIcon src={OKXWalletIcon} />,
injected,
'OKX Wallet'
)

// if no preferred wallet chosen
return [
okxWallet,
allWalletsOption
]
if (system === 'desktop') {
const okxWallet = getInjectedWalletOption(
wallet,
system,
() => {
setStep('download_await')
},
connect,
<WalletIcon src={OKXWalletIcon} />,
injected,
'OKX Wallet'
)

// if no preferred wallet chosen
return [
okxWallet,
allWalletsOption
]
} else {
const okxWallet = getWalletOption(
'okx_wallet',
'OKX Wallet',
system,
window.location.href,
chainId,
<WalletIcon src={OKXWalletIcon} />,
deeplinkRedirect,
claimCode,
wallet
)

// if no preferred wallet chosen
return [
okxWallet,
allWalletsOption
]
}

}

// @ts-ignore
Expand All @@ -220,6 +241,7 @@ const defineOptionsList = (
allWalletsOption
]
}

let injectedOption
if (defaultWalletApp === 'okx_wallet') {
injectedOption = getInjectedWalletOption(
Expand Down

0 comments on commit 55dccb2

Please sign in to comment.