Skip to content

Commit

Permalink
fix: 🚧 fix qr scan for send dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
jojobyte committed Feb 8, 2024
1 parent 5545717 commit 14aa58f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/rigs/send-or-request.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ export let sendOrRequestRig = (function (globals) {
class="rounded outline"
type="submit"
name="intent"
value="scan_new_contact"
value="scan_qr_code"
title="${state.scanAlt}"
>
<span>
Expand Down Expand Up @@ -271,7 +271,7 @@ export let sendOrRequestRig = (function (globals) {
// [event.target],
// )

if (fde?.intent === 'scan_new_contact') {
if (fde?.intent === 'scan_qr_code') {
appDialogs.scanContact.render(
{
wallet: state.wallet,
Expand All @@ -280,16 +280,18 @@ export let sendOrRequestRig = (function (globals) {
)

let showScan = await appDialogs.scanContact.showModal()
console.log(
'showScan',
showScan,
// scanContact,
// scanContact?.element?.returnValue
)
let [, addr] = showScan?.split('dash://')
if (addr) {
// event.target.addr.value = addr
event.target.to.value = showScan
if (showScan !== 'cancel') {
let parsedScan = parseAddressField(showScan)

console.log(
'showScan',
showScan,
parsedScan,
)

if (parsedScan?.address) {
event.target.to.value = parsedScan.address
}
}
return;
}
Expand Down

0 comments on commit 14aa58f

Please sign in to comment.