Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
refactor: marking transactions sent to self
Browse files Browse the repository at this point in the history
  • Loading branch information
mrfelton committed May 16, 2020
1 parent d0e765b commit c560bff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion renderer/reducers/transaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,13 @@ export const TRANSACTION_COMPLETE = 'TRANSACTION_COMPLETE'
* @returns {object} Decorated transaction
*/
const decorateTransaction = transaction => {
const isReceived = !transaction.isSending && CoinBig(transaction.amount).gt(0)
const isSent = !transaction.isSending && CoinBig(transaction.amount).lt(0)
const isToSelf = isSent && CoinBig.sum(transaction.totalFees, transaction.amount).isEqualTo(0)
const decoration = {
type: 'transaction',
isReceived: !transaction.isSending && CoinBig(transaction.amount).gt(0),
isReceived,
isToSelf,
}
return {
...transaction,
Expand Down

0 comments on commit c560bff

Please sign in to comment.