Skip to content

Commit

Permalink
fix(ui): 🐛 show/hide pass & wallet backup on first load/setup
Browse files Browse the repository at this point in the history
  • Loading branch information
jojobyte committed Feb 1, 2024
1 parent c20c80a commit b511813
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/components/dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,10 @@ const initialState = {
// resolve = res=>{},
// reject = res=>{},
) => {
console.log(
'handle dialog render',
state,
)
// console.log(
// 'handle dialog render',
// state,
// )
},
handleClose: (
state,
Expand Down
22 changes: 22 additions & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,27 @@ async function main() {
// .catch(console.error)
}
})
document.addEventListener('input', async event => {
let {
// @ts-ignore
name: fieldName, form,
} = event?.target

if (
fieldName === 'show_pass'
) {
event.stopPropagation()
event.preventDefault()

let { pass, show_pass, } = form

if (show_pass?.checked) {
pass.type = 'text'
} else {
pass.type = 'password'
}
}
})
document.addEventListener('change', async event => {
let {
// @ts-ignore
Expand Down Expand Up @@ -690,6 +711,7 @@ async function main() {
appDialogs.walletBackup.render(
{
wallet,
wallets,
},
'afterend',
)
Expand Down
2 changes: 1 addition & 1 deletion src/rigs/wallet-backup.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export let walletBackupRig = (function (globals) {
event.preventDefault()
event.stopPropagation()

let storedWallet = wallets?.[appState.selectedWallet]
let storedWallet = state.wallets?.[appState.selectedWallet]
let ks = storedWallet?.keystore
let fde = formDataEntries(event)

Expand Down

0 comments on commit b511813

Please sign in to comment.