Skip to content

Commit

Permalink
Merge pull request #80 from Koniverse/sw-develop
Browse files Browse the repository at this point in the history
Fix in-app browser wallet detection
  • Loading branch information
NorbertBodziony authored Jan 18, 2024
2 parents dad7a07 + ea0dd8f commit 6ef401c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions sdk/packages/selector-polkadot/src/detection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,12 @@ declare global {
}
export const getPolkadotWallets = (): PolkadotWalletInjected[] => {
if (window && window.injectedWeb3) {
return Object.entries(window.injectedWeb3).map(([key, value]) => {
// value.name might be undefined
value.name = value.name ?? key
value.slug = key
value.icon =
value.icon ?? appToIcon[key] ?? 'https://registry.nightly.app/networks/polkadot.png' // TODO add default icon
return value
})
return Object.entries(window.injectedWeb3).map(([key, value]) => ({
...value,
name: value.name ?? key, // value.name might be undefined
slug: key,
icon: value.icon ?? appToIcon[key] ?? 'https://registry.nightly.app/networks/polkadot.png' // TODO add default icon
}))
} else {
return []
}
Expand Down

0 comments on commit 6ef401c

Please sign in to comment.