Skip to content

Commit 2ea71ed

Browse files
authored
Merge pull request #209 from blocknative/develop
Release 1.2.4
2 parents f521451 + 40c0128 commit 2ea71ed

File tree

4 files changed

+28
-28
lines changed

4 files changed

+28
-28
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bnc-onboard",
3-
"version": "1.2.3",
3+
"version": "1.2.4",
44
"description": "Onboard users to web3 by allowing them to select a wallet, get that wallet ready to transact and have access to synced wallet state.",
55
"keywords": [
66
"ethereum",

src/components/Wallets.svelte

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import { fade } from 'svelte/transition'
32
import Button from '../elements/Button.svelte'
43
import IconButton from '../elements/IconButton.svelte'
54
import { WalletSelectModalData, WalletModule } from '../interfaces'
@@ -18,10 +17,7 @@
1817
align-items: center;
1918
list-style-type: none;
2019
margin: 1.25em 0;
21-
max-height: 66vh;
22-
overflow-y: scroll;
2320
padding: 0;
24-
scrollbar-width: none;
2521
font-family: inherit;
2622
font-size: inherit;
2723
line-height: 1.15;
@@ -51,14 +47,15 @@
5147
}
5248
5349
ul {
54-
scrollbar-width: unset;
50+
max-height: 66vh;
51+
overflow-y: scroll;
5552
}
5653
}
5754
</style>
5855

5956
<ul class="bn-onboard-custom bn-onboard-modal-select-wallets">
60-
{#each modalData.primaryWallets as wallet}
61-
<li in:fade>
57+
{#each modalData.primaryWallets as wallet, i (wallet.name)}
58+
<li>
6259
<IconButton
6360
onclick={() => handleWalletSelect(wallet)}
6461
iconSrc={wallet.iconSrc}
@@ -78,8 +75,8 @@
7875
{/if}
7976

8077
{#if showingAllWalletModules}
81-
{#each modalData.secondaryWallets as wallet}
82-
<li in:fade>
78+
{#each modalData.secondaryWallets as wallet, i (wallet.name)}
79+
<li>
8380
<IconButton
8481
onclick={() => handleWalletSelect(wallet)}
8582
iconSrc={wallet.iconSrc}

src/modules/select/wallets/metamask.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ function metamask(
4343
link: 'https://metamask.io/',
4444
installMessage: extensionInstallMessage,
4545
desktop: true,
46+
mobile: true,
4647
preferred
4748
}
4849
}

src/views/WalletSelect.svelte

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -66,31 +66,33 @@
6666
return !osExclusions.includes(os)
6767
})
6868
69+
if (deviceWallets.find(wallet => wallet.preferred)) {
70+
// if preferred wallets, then split in to preferred and not preferred
71+
primaryWallets = deviceWallets.filter(wallet => wallet.preferred)
72+
secondaryWallets = deviceWallets.filter(wallet => !wallet.preferred)
73+
} else {
74+
// otherwise make the first 4 wallets preferred
75+
primaryWallets = deviceWallets.slice(0, 4)
76+
secondaryWallets =
77+
deviceWallets.length > 4 ? deviceWallets.slice(4) : undefined
78+
}
79+
80+
modalData = {
81+
heading,
82+
description,
83+
primaryWallets,
84+
secondaryWallets
85+
}
86+
6987
if (appState.autoSelectWallet) {
7088
const module = deviceWallets.find(
7189
(m: WalletModule) => m.name === appState.autoSelectWallet
7290
)
7391
7492
app.update(store => ({ ...store, autoSelectWallet: '' }))
7593
76-
module ? handleWalletSelect(module) : finish({ completed: false })
77-
} else {
78-
if (deviceWallets.find(wallet => wallet.preferred)) {
79-
// if preferred wallets, then split in to preferred and not preferred
80-
primaryWallets = deviceWallets.filter(wallet => wallet.preferred)
81-
secondaryWallets = deviceWallets.filter(wallet => !wallet.preferred)
82-
} else {
83-
// otherwise make the first 4 wallets preferred
84-
primaryWallets = deviceWallets.slice(0, 4)
85-
secondaryWallets =
86-
deviceWallets.length > 4 ? deviceWallets.slice(4) : undefined
87-
}
88-
89-
modalData = {
90-
heading,
91-
description,
92-
primaryWallets,
93-
secondaryWallets
94+
if (module) {
95+
handleWalletSelect(module)
9496
}
9597
}
9698
}

0 commit comments

Comments
 (0)