Skip to content

Commit

Permalink
Fix missing default "Sent Bitcoin" payee data
Browse files Browse the repository at this point in the history
Need to check `metadata.name` for empty string then translate that into default text like "Sent Bitcoin"
  • Loading branch information
paullinator committed Jan 9, 2024
1 parent 250f516 commit 4a0f464
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/actions/CategoriesActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,22 +456,16 @@ export const getTxActionDisplayInfo = (tx: EdgeTransaction, account: EdgeAccount
notes
}

let userData: EdgeMetadata = {}
// User added metadata takes priority so override if present
if (metadata != null) {
userData = metadata
}

const mergedData: EdgeMetadata = {
name: userData.name ?? savedData.name,
category: userData.category ?? savedData.category,
notes: userData.notes ?? savedData.notes
name: metadata?.name != null && metadata.name.length > 0 ? metadata.name : savedData.name,
category: metadata?.category != null && metadata.category.length > 0 ? metadata.category : savedData.category,
notes: metadata?.notes != null && metadata.notes.length > 0 ? metadata.notes : savedData.notes
}

return {
direction,
savedData,
userData,
userData: metadata ?? {},
mergedData
}
}

0 comments on commit 4a0f464

Please sign in to comment.