Skip to content

Commit

Permalink
fix(ui): 🚑 unpaired contact hotfix
Browse files Browse the repository at this point in the history
  • Loading branch information
jojobyte committed Apr 15, 2024
1 parent 348a6e8 commit 4bdbd68
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions src/helpers/wallet.js
Original file line number Diff line number Diff line change
Expand Up @@ -1891,16 +1891,20 @@ export async function getContactsByXkeyId(
let contactsXkeys = {}

for await (let c of appState.contacts) {
let og = Object.values(c.outgoing)?.[0]
let ic = Object.values(c.incoming)?.[0]
let og = Object.values(c.outgoing || [])?.[0]
let ic = Object.values(c.incoming || [])?.[0]

contactsXkeys[og.xkeyId] = {
...c,
dir: 'outgoing',
if (og) {
contactsXkeys[og.xkeyId] = {
...c,
dir: 'outgoing',
}
}
contactsXkeys[ic.xkeyId] = {
...c,
dir: 'incoming',
if (ic) {
contactsXkeys[ic.xkeyId] = {
...c,
dir: 'incoming',
}
}
}

Expand Down Expand Up @@ -1937,8 +1941,8 @@ export async function deriveContactAddrs(
let addrs = {}

for await (let c of appState.contacts) {
let og = Object.values(c[dir])?.[0]
let xkey = og.xpub || og.xprv
let og = Object.values(c[dir] || [])?.[0]
let xkey = og?.xpub || og?.xprv

if (xkey) {
let contactWallet = await deriveWalletData(
Expand Down

0 comments on commit 4bdbd68

Please sign in to comment.