Skip to content

Commit ba9d894

Browse files
1.29.0-0.2.0: [fix] Keepkey issues (#607)
* 1.29.0-0.2.0: Move CTA, Enter btn, Preferred * version bump * Fix formatting * Remove cta change * Fixx format Co-authored-by: Aaron Barnard <abarnard@protonmail.com>
1 parent d913a56 commit ba9d894

File tree

4 files changed

+22
-14
lines changed

4 files changed

+22
-14
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.29.0-0.1.0",
3+
"version": "1.29.0-0.2.0",
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/modules/select/wallets/keepkey/entryModal.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const pinButtons = `
5656
const delButtonIcon = `<svg class="del-button-icon" viewBox="0 0 24 24" focusable="false" class="chakra-icon css-onkibi" aria-hidden="true"><path fill="currentColor" d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"></path></svg>`
5757

5858
const pinPhraseInput = (modalType: ModalType) => `
59-
<form class="pin-phrase-input-container">
59+
<form id="pin-phrase-form" class="pin-phrase-input-container">
6060
<input
6161
id="pin-phrase-input"
6262
placeholder="${modalType === ModalType.Pin ? 'PIN' : ''}"
@@ -254,6 +254,20 @@ export const renderModal = (wallet: KeepKeyHDWallet, modalType: ModalType) => {
254254
}
255255
} as SvelteComponentDev['new'])
256256

257+
// Submits the pin or passphrase to the Keepkey device
258+
const submit = async () => {
259+
const value = getInput().value
260+
modalType === ModalType.Pin
261+
? await wallet.sendPin(value)
262+
: await wallet.sendPassphrase(value)
263+
pinModal.$destroy()
264+
}
265+
266+
document.getElementById('pin-phrase-form')?.addEventListener('submit', e => {
267+
e.preventDefault()
268+
submit()
269+
})
270+
257271
// Creates a new Button component used to trigger sending the pin to Keepkey
258272
const entryEl = document.getElementById('entry')
259273
if (entryEl) {
@@ -264,13 +278,7 @@ export const renderModal = (wallet: KeepKeyHDWallet, modalType: ModalType) => {
264278
target: entryEl,
265279
props: {
266280
onclick: async () => {
267-
const value = getInput().value
268-
269-
modalType === ModalType.Pin
270-
? await wallet.sendPin(value)
271-
: await wallet.sendPassphrase(value)
272-
273-
pinModal.$destroy()
281+
submit()
274282
deleteWindowProperties()
275283
},
276284
$$slots: createSlot(span),

src/modules/select/wallets/keepkey/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ interface KeepProviderOptions {
4141
function keepkey(
4242
options: CommonWalletOptions & { rpcUrl: string; networkId: number }
4343
): WalletModule {
44-
const { label, iconSrc, rpcUrl, networkId } = options
44+
const { label, iconSrc, rpcUrl, networkId, preferred } = options
4545

4646
// Used to signal if the keep key could not be paired or if the keep key is already paired with another app
4747
let installMessage: string
@@ -90,7 +90,8 @@ function keepkey(
9090
: '',
9191
type: 'hardware',
9292
mobile: false,
93-
desktop: true
93+
desktop: true,
94+
preferred
9495
}
9596
}
9697

src/views/WalletCheck.svelte

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,8 @@
363363
{#if loading}
364364
<Spinner />
365365
{/if}
366-
<Button position="right" onclick={() => handleExit(false)}>
367-
Dismiss
368-
</Button>
366+
<Button position="right" onclick={() => handleExit(false)}>Dismiss</Button
367+
>
369368
</div>
370369
</Modal>
371370
{/if}

0 commit comments

Comments
 (0)